pawn Код:
COMMAND:setvip(playerid, params[])
{
if(pInfo[playerid][Adminlevel] >= 4)
{
new Target;
new Level;
if(!sscanf(params, "ui", Target,Level))
{
if(Level > 3) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: Maximum level is 3!");
if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: Invalid player ID");
if(pInfo[Target][Adminlevel] >= pInfo[playerid][Adminlevel]) return SendClientMessage(playerid,COLOR_RED,"{F81414}[ERROR]: {FFFFFF}This command is not available in this server! Type {F81414}/help {FFFFFF}for a list of commands.");
pInfo[Target][VIPlevel] = Level;
new tname[MAX_PLAYER_NAME];
GetPlayerName(Target,tname,sizeof(tname));
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
new MyString[128];
new TargetString[128];
format(MyString, sizeof(MyString), "You have set %s VIP Level to %i!", tname, Level);
format(TargetString, sizeof(TargetString), "You have been promoted to VIP Level %i, thanks to %s!", pname, Level);
SendClientMessage(Target, COLOR_RED, TargetString);
SendClientMessage(playerid,COLOR_GREEN,MyString);
}
else SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /setvip <playerid> <vip-level>");
}
else SendClientMessage(playerid, COLOR_RED, "[ERROR]: You have to be an Admin level 4 or higher to perform this command!");
return 1;
}
pawn Код:
if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: Invalid player ID");
pawn Код:
if(!IsPlayerConnect(Target)) return SendClientMessage(playerid, COLOR_RED,"[ERROR]: Invalid playerID");
pawn Код:
if(!IsPlayerConnected(Target)) return SendClientMessage(playerid, COLOR_RED,"[ERROR]: Invalid playerID");