Batista Posted November 25, 2011 Posted November 25, 2011 Hello all, today I create script that when you type /staff you'll be in staff team on TAB, but the problem that everyone can use it, so for that I need it only for admins who have acces to admin panel, please tell me how to do it. thank you.
0 12p Posted November 25, 2011 Posted November 25, 2011 I've got 2 ways to answer this. Which do you prefer?
0 Batista Posted November 25, 2011 Author Posted November 25, 2011 function joinStaffTeam ( source ) local staffteam = getTeamFromName ( "Staff" ) if ( staffteam ) then setPlayerTeam ( source, staffteam ) end end addCommandHandler ( "staff", joinStaffTeam )
0 12p Posted November 25, 2011 Posted November 25, 2011 function joinStaffTeam ( source ) local staffteam = getTeamFromName ( "Staff" ) local acc = getPlayerAccount ( source ) --Let's get the account of this guy if staffteam and not isGuestAccount ( acc ) and hasObjectPermissionTo ( "user."..getAccountName ( acc ), "command.ban" ) then --If the guy is logged in and can ban players (admin or higher) setPlayerTeam ( source, staffteam ) end end addCommandHandler ( "staff", joinStaffTeam )
Question
Batista
Hello all,
today I create script that when you type /staff you'll be in staff team on TAB, but the problem that everyone can use it, so for that I need it only for admins who have acces to admin panel, please tell me how to do it.
thank you.
7 answers to this question
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