Whats Wrong?
#2

pawn Код:
COMMAND:makeadmin(playerid, params[])
{
    new id;
    new AdminLevel2;
    if(!sscanf(params, "ui", id, AdminLevel2)) return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /makeadmin [PlayerId/PartOfName] [AdminLevel]");
    if(IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player Is Not Connected");
    if(PlayerInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You're not RCON Admin,You must be RCON Admin to use this COMMAND");
    if((AdminLevel2 >= 1 && AdminLevel2 <= 5) || AdminLevel2 == 0) return SendClientMessage(playerid, COLOR_GREEN, "Avaliable Levels: 1-5");

    new string[126];
    new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    GetPlayerName(id, PlayerName, sizeof(PlayerName));
    format(string, sizeof(string), ""red"[DU]:"green"Server Owner %s Has Set Your Level To %d", name, AdminLevel2);
    SendClientMessage(id, COLOR_GREEN, string);
    format(string, sizeof(string), "You Gave Admin Level %d To %s", AdminLevel2, PlayerName);
    SendClientMessage(playerid, COLOR_GREEN, string);
    PlayerInfo[id][AdminLevel] = AdminLevel2;
    return 1;
}
btw to check rcon admins you have to write " IsPlayerAdmin""
Reply


Messages In This Thread
Whats Wrong? - by Littlehelper - 24.02.2012, 05:41
Re: Whats Wrong? - by emokidx - 24.02.2012, 06:12
Re: Whats Wrong? - by Littlehelper - 24.02.2012, 06:20
Re: Whats Wrong? - by emokidx - 24.02.2012, 06:27
Re: Whats Wrong? - by Littlehelper - 24.02.2012, 06:36
Re: Whats Wrong? - by emokidx - 24.02.2012, 06:45

Forum Jump:


Users browsing this thread: 2 Guest(s)