SA-MP Forums Archive
Show cmds only for admins - 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)
+--- Thread: Show cmds only for admins (/showthread.php?tid=368192)



Show cmds only for admins - [HS]Syko - 12.08.2012

Hey samp community!

A need someone to script me this if possible.

I want to create a command for admins commands, /acmds.

Would work like this,

If ADMIN LV1 - lv1 admin commands - blablabla

If ADMIN LV2 - lv1 admin commands - blablabla
........................-lv2 admin commands - blablabla

If ADMIN LV3 - lv1 admin commands....
.......................- lv2 admin commands...
.........................-lv 3 admin commands

Etc.

Who tries to help me gets + 1 reputation and thanks: )


Re: Show cmds only for admins - phillip875 - 12.08.2012

What is your admin variable?

And basically works like this:

if(youradminvariable[playerid] >= 1)
{
SendClientMessage(playerid,-1,"Only lvl 1 or above can see this..");
}
if(youradminvarilable[playerid] >= 2)
{
SendClientMessage(playerid,-1,"Only lvl 2 or above can see this..");
}

Hope that helps.


Re: Show cmds only for admins - Djole1337 - 12.08.2012

pawn Код:
cmd(acmds,playerid, params[])
{
    if(GetAdminLevel(playerid) == 1) [Change this to your admin var]
        SendClientMessage(playerid, -1, "blablaba");
    if(GetAdminLevel(playerid) == 2)[Change this to your admin var]
    {
        SendClientMessage(playerid, -1, "blablaba");
    }
    if(GetAdminLevel(playerid) == 3)[Change this to your admin var]
    {
        SendClientMessage(playerid, -1, "blablaba");
    }
    if(GetAdminLevel(playerid) == 4)[Change this to your admin var]
    {
        SendClientMessage(playerid, -1, "blablaba");
    }
    if(GetAdminLevel(playerid) == 5)[Change this to your admin var]
    {
        SendClientMessage(playerid, -1, "blablaba");
    }
    return 1;
}