Help with admin levels - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with admin levels (
/showthread.php?tid=154664)
Help with admin levels -
[asg]davo - 14.06.2010
Ok so my server is almost ready to go but the last thong Im up to is adding admin levels.
And then make certain levels do certain commands.
Note: I know how it works but I don't no how to start the levels like do I need to download something
so if you could plz help me or if you could even give me a site or something where it will teach you thx
Re: Help with admin levels -
Naxix - 14.06.2010
It's just a variable e.g:
Код:
new admin[MAX_PLAYERS];
Код:
if(admin[playerid] == 0) return 0;
{
// Rest of admin code
}
Re: Help with admin levels -
[asg]davo - 14.06.2010
So if I wanted a level2 admin to use this command
Код:
if (strcmp("/armour", cmdtext, true, 10) == 0)
}
SetPlayerArmour(playerid,100);
{
return 1;
if u could put in so admins level 2 can use this command that would. Help we alot
Thx
Re: Help with admin levels -
Naxix - 14.06.2010
Now i don't use strcmp myself, but i give it a try.
Код:
if (strcmp("/armour", cmdtext, true, 10) == 0)
{
if(admin[playerid] != 2) return 0;
{
SetPlayerArmour(playerid,100);
}
}
return 1;
Re: Help with admin levels -
Cameltoe - 14.06.2010
Код:
if (strcmp("/armour", cmdtext, true, 10) == 0)
{
if(admin[playerid] >= 2)
{
SetPlayerArmour(playerid,100);
}else{return 0;}
}
return 1;
- Try this as this will allow people over level 2 to use the command also.
if admin level is less then 2 it will return as an unknown cmd
Good luck
Re: Help with admin levels -
[asg]davo - 14.06.2010
Thx alot all done but how do I make it stop at level7 do I just leave it the same as >=2 and it will stop at 7 if that's my highest level
Re: Help with admin levels -
Antonio [G-RP] - 14.06.2010
Doesn't need to stop, you won't get bugs
Re: Help with admin levels -
Cameltoe - 14.06.2010
Like mentioned it wont bugg ur server, but anyway here's how:
Код:
if (strcmp("/armour", cmdtext, true, 10) == 0)
{
if(admin[playerid] >= 2 && admin[playerid] <= 7)
{
SetPlayerArmour(playerid,100);
}else{return 0;}
}
return 1;
the only differnce then would be if somone is lvl 8 admin.. then it would said unknown cmd.
Re: Help with admin levels -
[asg]davo - 15.06.2010
ok thx very much