Help, Please
#1

Hello, Can someone add a Rank System to this Command

pawn Код:
CMD:a(playerid, params[])
{
    new sendername[MAX_PLAYER_NAME], string[160];
    if(!(PlayerInfo[playerid][pAdmin] >= 1)) return SendClientMessage(playerid, COLOR_LIGHTRED,"[D-RP]: {FFFFFF}You are Not an Administrator");
    if(isnull(params)) return SendClientMessage(playerid,COLOR_LIGHTRED,"[D-RP]: {FFFFFF}/a [Admin Chat]");
    GetPlayerName(playerid,sendername,sizeof(sendername));
    sendername[strfind(sendername,"_")] = ' ';
    format(string,160,"(( %d Admin %s: %s ))",PlayerInfo[playerid][pAdmin],sendername,params);
    SendAdminMessage(COLOR_LIGHTRED,string);
    return 1;
}
Example: (( Rank 1 Admin seanny: message ))
(( Rank 2 Admin seanny: message ))
and et cetra
Reply
#2

Easy:
pawn Код:
CMD:a(playerid, params[])
{
    new sendername[MAX_PLAYER_NAME], string[160];
    if(!(PlayerInfo[playerid][pAdmin] >= 1)) return SendClientMessage(playerid, COLOR_LIGHTRED,"[D-RP]: {FFFFFF}You are Not an Administrator");
    if(isnull(params)) return SendClientMessage(playerid,COLOR_LIGHTRED,"[D-RP]: {FFFFFF}/a [Admin Chat]");
    GetPlayerName(playerid,sendername,sizeof(sendername));
    sendername[strfind(sendername,"_")] = ' ';
   
    if(PlayerInfo[playerid][pAdmin] == 1)
    {
        format(string,160,"(( Moderator(%d) %s: %s ))",PlayerInfo[playerid][pAdmin],sendername,params);
        SendAdminMessage(COLOR_LIGHTRED,string);
    }
    if(PlayerInfo[playerid][pAdmin] == 2)
    {
        format(string,160,"(( Administrator(%d) %s: %s ))",PlayerInfo[playerid][pAdmin],sendername,params);
        SendAdminMessage(COLOR_LIGHTRED,string);
    }
    // And go on.
    return 1;
}
Reply
#3

Thanks Kingunit, Rep+'ed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)