17.12.2014, 14:32
pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf>
enum vInfo
{
Vip
}
new Vips[MAX_PLAYERS][vInfo];
//==========================/VIP================================================
CMD:setvip(playerid, params[])
{
new ID, Level, string[128], name[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME];
if(sscanf(params,"ui", ID, Level)) return SendClientMessage(playerid, -1, "{FF0000}Folosire: {FFFFFF}/SetVip [ID] [Nivel]");
if(IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "{FF0000}EROARE: {FFFFFF}Jucătorul nu este conectat.");
if(Level > 3) return SendClientMessage(playerid, -1, "{FF0000}EROARE: {FFFFFF}Nivel invalid. [1-3]");
if(Vips[ID][Vip] == Level) return SendClientMessage(playerid, -1, "{FF0000}EROARE: {FFFFFF}Jucătorul are deja nivelul acela de {FF0000}VIP {FFFFFF}.");
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(ID, pname, sizeof(pname));
format(string, sizeof(string), "{FF0000}[INFO]: {FFFFFF}Ai fost făcut de către {FF0000}%s {FFFFFF}nivel: {FF0000}%i {FFFFFF}de VIP.", name, Level);
SendClientMessage(ID, -1, string);
format(string, sizeof(string), "{FF0000}[INFO]: {FFFFFF}L-ai făcut pe {FF0000}%s {FFFFFF}nivel: {FF0000}%i {FFFFFF}de VIP.", pname, Level);
SendClientMessage(playerid, -1, string);
Vips[ID][Vip] = Level;
return 1;
}