[Help] My /ahelp command.
#1

Hey guys, I have a problem. Well it's about like a admin help command.So when the admin type like /adminhelp or something, it'll only shows the commands that are for their admin rank.

How do you do that?

Maybe you can show me how to do it.

Or give me a code?

Really need help with it.
Reply
#2

Here is an example


pawn Код:
if(strcmp(cmd, "/ahelp", true) == 0 || strcmp(cmd, "/ah", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 1)
            {
                SendClientMessage(playerid, COLOR_WHITE, "*** Duty *** /adminduty");
                SendClientMessage(playerid, COLOR_GRAD1, "*** Level 1 Moderator ***  /fly /check /setint /setvw /mute /kick /kickres /masked /unfreeze /learn");
                SendClientMessage(playerid, COLOR_GRAD1, "*** Level 1 Moderator *** /ban /slap /goto /a (/ao)oc /name /setskin /ajail /freeze /specplayer /checkweapons");
            }
            if (PlayerInfo[playerid][pAdmin] >= 2)
            {
                SendClientMessage(playerid, COLOR_GRAD2,"*** Level 2 Administrator *** /skydive /noooc /setteam /bigears /respawnthiscar(/rtc) /agl /setjob /update");
            }
            if (PlayerInfo[playerid][pAdmin] >= 3)
            {
                SendClientMessage(playerid, COLOR_GRAD3,"*** Level 3 Administrator *** /cnnn /fourdive /gotols /prison /unprison /aunlock /apark /fuelcars /edit /vehslap");
                SendClientMessage(playerid, COLOR_GRAD4,"*** Level 3 Administrator *** /mark /gotomark /gotolv /gotosf /gethere /oldcar /gotocar /getcar /setage");
                SendClientMessage(playerid, COLOR_GRAD4,"*** Level 3 Administrator *** /respawnallcars /respawnrentbikes /respawnrentcars /unban /unbanip /fixveh");
            }
            if (PlayerInfo[playerid][pAdmin] >= 4)
            {
                SendClientMessage(playerid, COLOR_GRAD4,"*** Level 4 Administrator *** /mole /logout /logoutpl /logoutall /asellhouse /asellbiz /sellsbiz /setchamp /mk");
                SendClientMessage(playerid, COLOR_GRAD4,"*** Level 4 Administrator *** /destroycars /sethp /setarmor /forceskin /explode /supervehslap");
            }
            if (PlayerInfo[playerid][pAdmin] >= 1337)
            {
                SendClientMessage(playerid, COLOR_GRAD5,"*** Lead Administrator ***  /weather /weatherall /makeircadmin /makeadmin /makeleader /bizentrance /sbizentrance");
                SendClientMessage(playerid, COLOR_GRAD5,"*** Lead Administrator *** /asellcar /setstat /money(sets money)");
                SendClientMessage(playerid, COLOR_GRAD5,"*** Lead Administrator *** /givemoney /givegun /crash /changename /houseentrance /housexit /tod /startlotto");
            }
            if (PlayerInfo[playerid][pAdmin] >= 1338)
            {
                SendClientMessage(playerid, COLOR_GRAD6,"***  ***");
            }
        }
        return 1;
    }
Reply
#3

Here is a blank one for an easier start.
pawn Код:
CMD:ahelp(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] > 1)
    {
        //commands here.
    }
    else if(PlayerInfo[playerid][pAdminLevel] > 2)
    {
        //commands here
    }
    return 1;
}
Reply
#4

It really depends on what admin system you're using.
Reply
#5

Quote:
Originally Posted by Edward156
Посмотреть сообщение
It really depends on what admin system you're using.
No it doesn't, he asked for a command on showing a list of commands for a specific admin rank.

You sir, are either stupid or just stupid.
Reply
#6

Quote:
Originally Posted by Windows32
Посмотреть сообщение
No it doesn't, he asked for a command on showing a list of commands for a specific admin rank.

You sir, are either stupid or just stupid.
Well, saying that won't show that you are very clever or even more intelligent lol ( no offense ).

Quote:
Originally Posted by poster
when the admin type like /adminhelp or something, it'll only shows the commands that are for their admin rank.
Windows32 you might need spectacles to read the bold.

Quote:
Originally Posted by Windows32
Посмотреть сообщение
Here is a blank one for an easier start.
pawn Код:
CMD:ahelp(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] > 1)
    {
        //commands here.
    }
    else if(PlayerInfo[playerid][pAdminLevel] > 2)
    {
        //commands here
    }
    return 1;
}
Also this post is so useless lol it will only work for id 1 :/

Poster:So for that you will need to know the correct variables which your game-mode is using. If you want to use a default admin system which is RCON you can always use "IsPlayerAdmin".

For levels you need your own system and Edward is right it depends on your admin system. If you know the vars you can easily make it.

And to correct Windows32's script; remember, it is not necessary to use "IsPlayerConnected" in the command. You must use your common sense that if the player is not connected how he is going to use that command lol? think.

-FalconX
Reply
#7

Quote:
Originally Posted by Windows32
Посмотреть сообщение
Here is a blank one for an easier start.
pawn Код:
CMD:ahelp(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] > 1)
    {
        //commands here.
    }
    else if(PlayerInfo[playerid][pAdminLevel] > 2)
    {
        //commands here
    }
    return 1;
}
Thanks for the help!
Reply
#8

Quote:
Originally Posted by Windows32
Посмотреть сообщение
Here is a blank one for an easier start.
pawn Код:
CMD:ahelp(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] > 1)
    {
        //commands here.
    }
    else if(PlayerInfo[playerid][pAdminLevel] > 2)
    {
        //commands here
    }
    return 1;
}
This code is completely useless. So if the player has an admin level greater than 1, it will show only the commands for the level 1 admin... Think before you post shit like this Windows32.
Reply
#9

Then how can I make the code like a higher admin can show the all the commands that are lower admin rank commands?
Reply
#10

Check the first reply. I already put the clear example. Let me explain. Just edit the first reply of mine's variable to the admin variable you following mine admin rank variable is "pAdmin" and the rank number. Then edit the command that you need for respective admin rank. When you do /ah ingame the script will execute upto the rank you have. Got it?
If not i will explain when i get my pc back or anyone will help you.


Send via mobile.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)