Jump to content

Whats wrong?


s1mple

Recommended Posts

Client.lua

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) 

Server.lua

function startgm() 
    accountname = getAccountName(getPlayerAccount(thePlayer)) 
    if isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then 
    do 
    if not getElementData(getLocalPlayer(), "onduty") then 
      gmtimer = setTimer(gmforad, 2000, 0) 
      outputChatBox ("Admin is now: ON DUTY",255, 255, 255,true) 
      setElementData(getLocalPlayer(), "onduty", true) 
    else 
      killTimer (gmtimer) 
      setElementData(getLocalPlayer(),"blood", 12000) 
      outputChatBox ("Admin is now: OFF DUTY!",255, 255, 255,true) 
      setElementData(getLocalPlayer(), "onduty", false) 
    end 
end 
addEvent("onPlayerOnDuty", true) 
addEventHandler("onPlayerOnDuty", thePlayer, startgm) 
  
function gmforad() 
    if getElementData(getLocalPlayer(),"logedin") then 
        setElementData(getLocalPlayer(),"blood", 500000) 
        setElementData(getLocalPlayer(),"bleeding", 0) 
        setElementData(getLocalPlayer(),"cold", false) 
        setElementData(getLocalPlayer(),"temperature", 37) 
        setElementData(getLocalPlayer(),"pain", false) 
        setElementData(getLocalPlayer(),"brokenbone", false) 
        setElementData(getLocalPlayer(),"thirst", 100) 
        setElementData(getLocalPlayer(),"food", 100) 
    end 
end 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...