I have made a police computer to tell me how many arrests i got and to show all criminals online in the server,, problem is that it totally not working, i checked the code many times cannot get the problem..
--Client
function createwindow(theAccount, getdata)
if ( guiGetVisible ( window1 ) == false ) then
playerTeam = getPlayerTeam ( source )
if getTeamName(playerTeam) == "Police" then
guiSetVisible (window1, true)
triggerServerEvent ( "setarrests", localPlayer, playerTeam)
guiSetText ( arrests_lab2, getdata )
else
if ( guiGetVisible ( window1 ) == true ) then
guiSetVisible (window1, false)
end
end
end
end
addCommandHandler ( "pcomp", createwindow )
--Server
function getdatas()
theAccount = getPlayerAccount ( source )
local getdata = getAccountData(theAccount, "Arrests.count")
end
addEvent("setarrests", true)
addEventHandler("setarrests", root, getdatas)
There is no shown errors
( i know my code is nasty, i am still learning )