Jump to content

Dayz admin duty help pls


Manic69

Recommended Posts

Hello!

Can someone help me,I have this simple duty script

function giveblood (thePlayer)
local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then
       
        end          
        outputChatBox ("#6B8E23 [Owner] #FFFFFF"..getPlayerName(thePlayer).."#1AFF00 Is now onduty NO DM !",root,255,255,255,true)
    setElementData(thePlayer, "blood",999999999)
end
addCommandHandler("duty", giveblood)
 
function bloodback(thePlayer)
local account = getAccountName ( getPlayerAccount ( thePlayer ) )
        if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then
 
        end
        outputChatBox ("#6B8E23 [Owner]  #FFFFFF"..getPlayerName(thePlayer).."#FF0000 Is now offduty",root,255,255,255,true)
    setElementData(thePlayer, "blood",12000)
end
addCommandHandler("offduty", bloodback)

 

The problem is that everyone works not only for admin.

And if someone know how to add 3D text write me pls 

TY!

Link to comment
  • Moderators

The code for admins should have been INSIDE the "if" statement that checks for admin ACL group:

function giveblood (thePlayer)
    local account = getAccountName ( getPlayerAccount ( thePlayer ) )
    if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then
        outputChatBox ("#6B8E23 [Owner] #FFFFFF"..getPlayerName(thePlayer).."#1AFF00 Is now onduty NO DM !",root,255,255,255,true)
        setElementData(thePlayer, "blood", 999999999)
    end
end
addCommandHandler("duty", giveblood)
 
function bloodback(thePlayer)
    local account = getAccountName ( getPlayerAccount ( thePlayer ) )
    if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then
        outputChatBox ("#6B8E23 [Owner]  #FFFFFF"..getPlayerName(thePlayer).."#FF0000 Is now offduty",root,255,255,255,true)
        setElementData(thePlayer, "blood", 12000)
    end
end
addCommandHandler("offduty", bloodback)

 

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