Jump to content

dex.

Members
  • Posts

    33
  • Joined

  • Last visited

Everything posted by dex.

  1. I wanna draw text on my head, if im on duty, but this does nofting.
  2. 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?
  3. getTickCount -- use this to calculate how much time he spent.(it's in milliseconds) https://wiki.multitheftauto.com/wiki/onPlayerJoin -- start tick count when a player joins https://wiki.multitheftauto.com/wiki/onPlayerQuit -- end tick count when he quits
  4. dex.

    [Help] With text

    Thats very nice, but theres is a one problem, script dosen't kill timer after offduty...
  5. Hey. I have little issue with adding two text to script What i wanna do is If Admin writes /duty then scripts says outchatbox for everyone "Admin is on duty" and if Admin writes again /duty then then scripts says outchatbox for everyone "Admin is off duty" script: function duty(thePlayer) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then setTimer ( function() setElementData (thePlayer, "brokenbone", false) setElementData (thePlayer, "bleeding", false) setElementData (thePlayer, "pain", false) setElementData (thePlayer, "cold", false) setElementData (thePlayer, "temperature", 36.5) setElementData (thePlayer, "blood", 12000) setElementData (thePlayer, "food", 100) setElementData (thePlayer, "thirst", 75) end, 50,0) end end addCommandHandler("duty", duty)
×
×
  • Create New...