Jump to content

Duty command


DarkByte

Recommended Posts

Posted

I made a command that sets a player to be on duty but it wont work.

  
function duty (playerSource) 
if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( playerSource ) ), aclGetGroup ( "Admin" ) ) 
setElementData(playerSource,"duty",true) 
outputChatBox("It works") 
else 
setElementData(playerSource,"duty",false) 
end 
end 
  
addCommandHandler("duty",duty) 

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted

It is.Nothing in debug

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted
function duty (playerSource) 
    local acc = getPlayerAccount ( playerSource ) 
    if (acc and not isGuestAccount(acc)) then 
        if isObjectInACLGroup ( "user.".. getAccountName ( acc ), aclGetGroup ( "Admin" ) ) 
            setElementData(playerSource,"duty",true) 
            outputChatBox("It works", playerSource) 
        else 
            setElementData(playerSource,"duty",false) 
            outputChatBox("You're not an Admin!", playerSource) 
        end 
    else 
        outputChatBox("You're not logged it!", playerSource) 
    end 
end 
addCommandHandler("duty",duty) 

Try this.

Need a scripter? Feel free to contact me for inexpensive high-quality service!

Skype username: friedonibot

Posted
function duty (playerSource) 
    local acc = getPlayerAccount ( playerSource ) 
    if (acc and not isGuestAccount(acc)) then 
        if isObjectInACLGroup ( "user.".. getAccountName ( acc ), aclGetGroup ( "Admin" ) ) 
            setElementData(playerSource,"duty",true) 
            outputChatBox("It works", playerSource) 
        else 
            setElementData(playerSource,"duty",false) 
            outputChatBox("You're not an Admin!", playerSource) 
        end 
    else 
        outputChatBox("You're not logged it!", playerSource) 
    end 
end 
addCommandHandler("duty",duty) 

Try this.

You forgot "then".

if isObjectInACLGroup ("user.".. getAccountName (acc), aclGetGroup ("Admin")) then 

Posted

Works, but when i type duty 2nd time it wont set to false

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

Posted
function duty (playerSource) 
    local acc = getPlayerAccount ( playerSource ) 
    if (acc and not isGuestAccount(acc)) then 
        if isObjectInACLGroup ( "user.".. getAccountName ( acc ), aclGetGroup ( "Admin" ) ) then 
            setElementData(playerSource,"duty",not getElementData(playerSource,"duty")) 
        else 
            outputChatBox("You're not an Admin!", playerSource) 
        end 
    else 
        outputChatBox("You're not logged it!", playerSource) 
    end 
end 
addCommandHandler("duty",duty) 

Need a scripter? Feel free to contact me for inexpensive high-quality service!

Skype username: friedonibot

Posted

Thanks, working

When I hear someone saying Mac is better than PC.

o0pjNKG.gif w0t?VeJXjxD.gifw0t? evspcFJ.gifw0t?

Great minds discuss ideas, average minds discuss events and small minds discuss people.

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