DarkByte Posted January 8, 2016 Share Posted January 8, 2016 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) Link to comment
Revolt Posted January 8, 2016 Share Posted January 8, 2016 It has to be server-sided. Link to comment
DarkByte Posted January 8, 2016 Author Share Posted January 8, 2016 It is.Nothing in debug Link to comment
Revolt Posted January 8, 2016 Share Posted January 8, 2016 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. Link to comment
1LoL1 Posted January 8, 2016 Share Posted January 8, 2016 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 Link to comment
DarkByte Posted January 8, 2016 Author Share Posted January 8, 2016 Works, but when i type duty 2nd time it wont set to false Link to comment
Revolt Posted January 8, 2016 Share Posted January 8, 2016 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) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now