22.10.2013, 10:02
how to add this system in this code below.
pawn Код:
COMMAND:makevip(playerid, params[])
{
if(GetPlayerAdminLevel(playerid) < 7) return SendClientMessage(playerid, COLOR_ORANGE, "=> You're not authorized to use this command!");
new target, level;
if(sscanf(params, "ui", target, level)) return SendClientMessage(playerid, COLOR_ORANGE, "=> Usage: /makevip [playerid/name] [level]");
else if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ORANGE, "=> Enter a valid player ID/name!");
SetPVarInt(target, "VIP", level);
new string[128], pName[MAX_PLAYER_NAME], gName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
GetPlayerName(target, gName, MAX_PLAYER_NAME);
format(string, sizeof string, "=> Admin %s has set %s VIP.", pName, gName);
SendClientMessageToAdmins(string);
format(string, sizeof string, "=> Admin %s has set your VIP level to %i.", pName, level);
SendClientMessage(target, COLOR_ROYALBLUE, string);
format(string, sizeof string, "%s set %s admin level to: %i", pName, gName, level);
Log("MakeAdmin", string);
return 1;
}