Command: /makeadmin help
#8

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
Well depends on your registration system make the following code suitable to it.
pawn Код:
CMD:makeadmin(playerid, params[])
{
        if(PlayerInfo[ playerid ][ PLAYER_LEVEL] < 5) return SendClientMessage(playerid, -1, "ERROR: You are not high enough level bla bla");//If his level is less than 5 he can't use this command
        //Change the line above to be suiable
        new level, aname[MAX_PLAYER_NAME];//Variables to be used further on
        new targetid;//This variable will be assigned to the dude who's level will be changed
        if(sscanf(params, "ui", targetid, level)) return SendClientMessage(playerid, -1, "ERROR: /makeadmin (playerid/name) (level)");
        if (level > 5 || level < 0) return SendClientMessage(playerid, -1, "ERROR:INVALID level");//This will limit the levels from 1 to 5,(editable)
        if(!IsPlayerConnected( targetid )) return SendClientMessage(playerid, -1, "ERROR:INVALID player");//This will be called incase the player isn't connected
        new string1[130], tname[MAX_PLAYER_NAME], string2[130];//String to send
        PlayerInfo[targetid][ PLAYER_LEVEL ] = level;//This part will set his level
        GetPlayerName(playerid, aname, sizeof(aname));
        GetPlayerName(targetid, tname, sizeof(tname));
        format(string2, sizeof(string1), "Admin %s has set %s's level to %i", aname, tname, level);//This will be sent to all players
        SendClientMessageToAll(Yellow, string2);
    return 1;
}
I can only see that you changed his Admin Variable and changed some Variable names.....
Reply


Messages In This Thread
Command: /makeadmin help - by Areax - 04.04.2013, 12:40
Re: Command: /makeadmin help - by Konstantinos - 04.04.2013, 12:45
Re: Command: /makeadmin help - by SilverKiller - 04.04.2013, 12:45
Re: Command: /makeadmin help - by Areax - 04.04.2013, 12:46
Re: Command: /makeadmin help - by SilverKiller - 04.04.2013, 12:49
Re: Command: /makeadmin help - by Areax - 04.04.2013, 12:51
Re: Command: /makeadmin help - by DaRk_RaiN - 04.04.2013, 12:51
Re: Command: /makeadmin help - by SilverKiller - 04.04.2013, 12:56
Re: Command: /makeadmin help - by DaRk_RaiN - 04.04.2013, 13:01
Re: Command: /makeadmin help - by SilverKiller - 04.04.2013, 13:03

Forum Jump:


Users browsing this thread: 2 Guest(s)