Easy coding help!
#2

pawn Code:
CMD:makeadmin(playerid, params[])
{
    new pID, value;
    if(PlayerInfo[playerid][pAdmin] => 1338 && IsPlayerAdmin(playerid))
    {
    if(!sscanf(params, "ui", pID, value))
    {
    if (value > 0 && value <= 1338)
    {
    if(IsPlayerConnected(pID))
    {
        new pName[MAX_PLAYER_NAME], tName[MAX_PLAYER_NAME], string[128];
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        GetPlayerName(pID, tName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "You have promoted %s to Admin level %i", tName, value);
        SCM(playerid, COLOR_GREEN, string);
        format(string, sizeof(string), "You have been promoted to Admin level %i by %s", value, pName);
        SCM(pID, COLOR_GREEN, string);
        PlayerInfo[pID][pAdmin] = value;
        return 1;
    }
    else return SCM(playerid, COLOR_RED,"Invalid player id.");
    }
    return SendClientMessage(playerid, COLOR_RED, "Unknown level! Only 0 to 1338.");
    }
    else return SendClientMessage(playerid, COLOR_GREY, "Usage: /makeadmin [playerid/partofname] [level 1-1338].");
    }
    return SendClientMessage(playerid, COLOR_RED, "You are not authorized to use this command.");
}
Reply


Messages In This Thread
Easy coding help! - by Chrillzen - 02.02.2012, 13:44
Re: Easy coding help! - by milanosie - 02.02.2012, 14:16
Re: Easy coding help! - by 2KY - 02.02.2012, 14:17

Forum Jump:


Users browsing this thread: 1 Guest(s)