Jump to content

[HELP] Staff Script


HeK

Recommended Posts

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

  • Like 1
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...