Jump to content

DxDrawText On Duty problem


s1mple

Recommended Posts

server.lua

outputChatBox("",getRootElement(),255,0,0) 
outputServerLog(" Administrator "..getPlayerName(player).." Is Now OnDuty!") 
setElementData( player, "blood", 99999999999999999999999 ) 
heal = "9999999999999999999999999999" 
triggerClientEvent(player,"onDuty",getRootElement()) 
end 
end 
addCommandHandler("duty",aduty) 
  
function offaduty ( player ) 
local accName = getAccountName(getPlayerAccount(player)) 
if isObjectInACLGroup ( "user." ..accName, aclGetGroup ( "Admin") ) then 
outputChatBox(" Administrator "..getPlayerName(player).." Is No Longer OnDuty!",getRootElement(),255,0,0) 
outputChatBox("",getRootElement(),255,0,0) 
outputServerLog(" Administrator "..getPlayerName(player).." Is No Longer OnDuty!") 
setElementData( player, "blood", 12000 ) 
end 
end 
addCommandHandler("offaduty",offduty) 
  
function heal_func ( player ) 
local accName = getAccountName(getPlayerAccount(player)) 
if isObjectInACLGroup ( "user." ..accName, aclGetGroup ( "Admin") ) then 
if heal == "an" then 
setElementData( player, "food", 250 ) 
setElementData( player, "thirst", 250 ) 
end 
end 
end 
setTimer(heal_func, 60000, 0) 

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) 

error

[2015-11-07 21:12:32] restart: Requested by Console 
[2015-11-07 21:12:32] restart: Resource restarting... 
[2015-11-07 21:12:32] Stopping Duty 
[2015-11-07 21:12:32] Resource 'Duty' changed, reloading and starting 
[2015-11-07 21:12:32] Starting Duty 
[2015-11-07 21:12:32] SCRIPT ERROR: Duty\Server.lua:6: '' expected near 'end' 
[2015-11-07 21:12:32] ERROR: Loading script failed: Duty\Server.lua:6: '' expected near 'end' 
[2015-11-07 21:12:32] Duty restarted successfully 

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...