HeK Posted May 6, 2012 Share Posted May 6, 2012 Hey guys, i need help on this script, i dont know what's wrong. When i do the command it gives a Bad argument on "getPlayerAccount", "getAccountName". function createAdminTeamOnStart () AdminTeam = createTeam ( "Staff", 250, 250, 250 ) end addEventHandler("onResourceStart", resourceRoot, createAdminTeamOnStart) function setAdminTeam() if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then setPlayerTeam(source, AdminTeam) setElementModel(source, 217) end end addCommandHandler( "staff", setAdminTeam ) Link to comment
Castillo Posted May 6, 2012 Share Posted May 6, 2012 function createAdminTeamOnStart ( ) AdminTeam = createTeam ( "Staff", 250, 250, 250 ) end addEventHandler ( "onResourceStart", resourceRoot, createAdminTeamOnStart ) function setAdminTeam ( thePlayer ) -- You forgot to define the player who used the command. if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) then setPlayerTeam ( thePlayer, AdminTeam ) setElementModel ( thePlayer, 217 ) end end addCommandHandler ( "staff", setAdminTeam ) Read the comment. 1 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