20.03.2015, 05:06
I want to make a command that set player vip that I have done but I want to make log file for this command and I want to make "PROMOTED!" & "DEMOTED!" text to player who is promoted/demoted with message "Administrator %s has set you to VIP Status [Level:%d]" (DONE) but I want this too "Administrator %s has set you to Player Status [Level: %d]" I can't make this please help me. Here is the code:
pawn Код:
CMD:setvip(playerid, params[])
{
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, RCONERROR);
{
if(PlayerInfo[playerid][pVipLevel] == 1) { vrank = "Bronze V.I.P"; }
else if(PlayerInfo[playerid][pVipLevel] == 2) { vrank = "Silver V.I.P"; }
else if(PlayerInfo[playerid][pVipLevel] == 3) { vrank = "Gold V.I.P"; }
{
new victimname[MAX_PLAYER_NAME], vipname[MAX_PLAYER_NAME], viplevel, giveplayerid, string[128];
if(sscanf(params, "ui", giveplayerid, viplevel)) return SendClientMessage(playerid, COLOR_DGRAY, "Syntax: /setvip [playerid] [level]");
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected");
if(viplevel > 3 || viplevel < 0) return SendClientMessage(playerid, COLOR_RED, "ERROR: Valid levels: 1-3");
PlayerInfo[giveplayerid][pVipLevel] = viplevel;
GetPlayerName(giveplayerid, victimname, sizeof(victimname));
GetPlayerName(playerid, vipname, sizeof(vipname));
PlayerInfo[giveplayerid][pVipLevel] = viplevel;
GetPlayerName(giveplayerid, victimname, sizeof(victimname));
GetPlayerName(playerid, vipname, sizeof(vipname));
format(string,sizeof(string),"Administrator %s(%d) has set you to VIP Status! [Level: %i]", vipname, playerid, viplevel, giveplayerid);
SendClientMessage(playerid, COLOR_AQUA, string);
format(string, sizeof(string), ">> You set %s(%d) VIP level to '%i'", victimname, playerid, viplevel, giveplayerid);
SendClientMessage(playerid, COLOR_DGRAY, string);
}
}
return 1;
}