24.02.2012, 05:41
Hello,
I've made a Makeadmin command for my Administration System,
but for some reason, it sends "Unknown Command" Error.
Here's The Code
Thank You.
I've made a Makeadmin command for my Administration System,
but for some reason, it sends "Unknown Command" Error.
Here's The Code
pawn Код:
COMMAND:makeadmin(playerid, params[])
{
new id;
new AdminLevel2;
if(IsPlayerConnected(id))
{
if(PlayerInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid))
{
if(!sscanf(params, "ui", id, AdminLevel2))
{
if((AdminLevel2 >= 1 && AdminLevel2 <= 5) || AdminLevel2 == 0)
{
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;
}
else return SendClientMessage(playerid, COLOR_GREEN, "Avaliable Levels: 1-5");
}
else return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /makeadmin [PlayerId/PartOfName] [AdminLevel]");
}
else return SendClientMessage(playerid, COLOR_RED, "You're not RCON Admin,You must be RCON Admin to use this COMMAND");
}
else return SendClientMessage(playerid, COLOR_RED, "Player Is Not Connected");
}