Jump to content

problem with admin duty for dayz


Dimmitry007

Recommended Posts

function aduty ( player )

local accName = getAccountName(getPlayerAccount(player))

if isObjectInACLGroup ( "user." ..accName, aclGetGroup ( "Admin") ) then

outputChatBox("Admin "..getPlayerName(player).." Is Now OnDuty!",getRootElement(),255,0,0)

outputChatBox("",getRootElement(),255,0,0)

outputServerLog("Admin "..getPlayerName(player).." Is Now OnDuty!")

setElementData( player, "blood", 999999999999999 )

heal = "999999999999999"

end

end

addCommandHandler("aduty",aduty)

function offaduty ( player )

local accName = getAccountName(getPlayerAccount(player))

if isObjectInACLGroup ( "user." ..accName, aclGetGroup ( "Admin") ) then

outputChatBox("Admin "..getPlayerName(player).." Is No Longer OnDuty!",getRootElement(),255,0,0)

outputChatBox("",getRootElement(),255,0,0)

outputServerLog("Admin "..getPlayerName(player).." Is No Longer OnDuty!")

setElementData( player, "blood", 12000 )

end

end

addCommandHandler("offduty",offaduty)

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)

Link to comment

try this

function aduty(player)     
 local accName = getAccountName(getPlayerAccount(player)) 
    if isObjectInACLGroup ( "user." ..accName, aclGetGroup ( "Admin") ) then        
    setElementData(player, "blood", 9999999)    
    outputChatBox("Admin "..getPlayerName(player).." Is Now OnDuty!",getRootElement(),255,0,0)   
    outputServerLog("Admin "..getPlayerName(player).." Is Now OnDuty!") 
    end 
end 
addCommandHandler("onduty", suicidex, false) 
  
function aoffduty(player) 
 local accName = getAccountName(getPlayerAccount(player)) 
      if isObjectInACLGroup ( "user." ..accName, aclGetGroup ( "Admin") ) then 
      setElementData(player, "blood", 12000)    
      outputChatBox("Admin "..getPlayerName(player).." Is Now OffDuty!",getRootElement(),255,0,0) 
      outputServerLog("Admin "..getPlayerName(player).." Is Now OffDuty!") 
      end 
end 
addCommandHandler("offduty", suicidex, false)    
  
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 ) 
setElementData( player, "blood", 12000 ) 
end 
end 
end 
addCommandHandler("aheal", heal_func, false)   

Edited by Guest
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...