SkatCh Posted May 18, 2014 Share Posted May 18, 2014 hi guys please how can i fix this : i create Staff Team : function createStaff ( ) StaffTeam = createTeam ( "Staff", 123, 0, 123 ) end addEventHandler ( "onResourceStart", resourceRoot, createStaff ) but i have problem here : function setStaffTeam ( thePlayer ) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Head Staff" ) ) then if (getTeamName (getPlayerTeam(thePlayer))) == ("Staff") then outputChatBox("You are already in the group!", thePlayer, 150,0,0, false) else oldSkin = getPedSkin(thePlayer) setPlayerTeam ( thePlayer, StaffTeam ) setElementModel ( thePlayer, 217 ) end end end addCommandHandler ( "staff", setStaffTeam ) when i press T/staff this error appear : Bad argument @ 'getTeamName' . Link to comment
justn Posted May 18, 2014 Share Posted May 18, 2014 if (getTeamName (getPlayerTeam(thePlayer))) == ("Staff") then Should Be if ( getTeamName ( getPlayerTeam ( thePlayer ) == "Staff" )) then Link to comment
.:HyPeX:. Posted May 18, 2014 Share Posted May 18, 2014 No. It was okay, thought not so many brackets needed. if getTeamName(getPlayerTeam(thePlayer)) == "Staff" then Just the ACL Group i'm unsure if it will work becouse it has a space. try making the ACL group without spaces. Link to comment
tosfera Posted May 18, 2014 Share Posted May 18, 2014 Make sure you are in a team before using the command, you can also avoid that by using getPlayerTeam. If it returns false, you know the player isn't in a team. Another thing you can do, is to use isPlayerInTeam which will also return true or false. 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