So. i have little problem with client side. Console and debugmonitor3 dosen't say anything.
Server Side:
local onDuty = {}
addCommandHandler('duty',function(player,cmd)
local accName = getAccountName(getPlayerAccount(player))
if isObjectInACLGroup('user.'..accName,aclGetGroup('Admin')) then
if not onDuty[player] or onDuty[player] == false then
onDuty[player] = true
outputChatBox("#F10404[ADMINISTRATOR] #FF8B00 "..getPlayerName(player)..' #04F42Cis now on duty!', getRootElement(), 255, 255, 255, true)
triggerClientEvent(player,"onDuty",getRootElement())
timer1 = setTimer(function()
setElementAlpha(player, 0)
setElementData(player,'brokenbone',false)
setElementData(player,'bleeding',false)
setElementData(player,'pain',false)
setElementData(player,'cold',false)
setElementData(player,'temperature',36.5)
setElementData(player,'blood',12000)
setElementData(player,'food',100)
setElementData(player,'thirst',75)
end,50,0)
else
onDuty[player] = false
setElementAlpha(player, 255)
outputChatBox("#F10404[ADMINISTRATOR] #FF8B00 "..getPlayerName(player)..' #3600FF is now off duty!', getRootElement(), 255, 255, 255, true)
if isTimer(timer1) then
killTimer(timer1)
end
end
end
end)
Client Side:
addEvent ( "onDuty", true )
function duty()
if getElementData(source,"duty") == true then
timer = setTimer ( function()
setElementData(source,"onDuty",true)
local x, y, z = getElementPosition(source )
local playerName = getPlayerName(source )
local theText = dxDraw3DText( "Admin On Duty [NO DM]", x, y, z+1,05,"default",255,0,0,200)
setTimer ( function()
destroyElement(theText)
end, 59, 1)
end, 60, 0 )
else
if isTimer(timer) then
killTimer(timer)
end
setElementData(source,"duty",true)
end
end
addEventHandler ( "onDuty", root, duty)
Do anyone have solution?