Batista Posted November 25, 2011 Share 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. Link to comment
0 sckatchof Posted November 25, 2011 Share Posted November 25, 2011 And I also I have the same problem Link to comment
0 12p Posted November 25, 2011 Share Posted November 25, 2011 I've got 2 ways to answer this. Which do you prefer? Link to comment
0 Batista Posted November 25, 2011 Author Share Posted November 25, 2011 Idk, give me the 1st Link to comment
0 12p Posted November 25, 2011 Share Posted November 25, 2011 Okay. Show me your code. Link to comment
0 Batista Posted November 25, 2011 Author Share Posted November 25, 2011 function joinStaffTeam ( source ) local staffteam = getTeamFromName ( "Staff" ) if ( staffteam ) then setPlayerTeam ( source, staffteam ) end end addCommandHandler ( "staff", joinStaffTeam ) Link to comment
0 12p Posted November 25, 2011 Share 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 ) Link to comment
0 Batista Posted November 25, 2011 Author Share Posted November 25, 2011 Thank you Ben Link to comment
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.
Link to comment
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