CMD:stats(playerid,params[])
{
new name[MAX_PLAYER_NAME];
new id;
GetPlayerName(id, name, sizeof(name));
if(sscanf(params,"d",id)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /stats <ID>");
if (!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected.");
new string[128];
new Float:ratio=floatdiv(PlayerInfo[id][pKills], PlayerInfo[id][pDeaths]);
format(string, 128, "%d %d %.2f", PlayerInfo[id][pKills], PlayerInfo[id][pDeaths], ratio);
format(string, sizeof(string), "Name: %s (ID:%d)\nAdmin Level :%d\nKills : %d\nDeaths : %d\nKill/Death Ratio: %.2f\nScore: %d",name, id, PlayerInfo[id][pAdmin], PlayerInfo[id][pKills], PlayerInfo[id][pDeaths], ratio,PlayerInfo[id][pScore]);
ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"Player Stats",string,"Close","");
return 1;
}
if(sscanf(params,"d",id)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /stats <ID>");
if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /stats <ID>");
new target=playerid; if(!isnull(params)) sscanf(params, "r", target);
CMD:stats(playerid,params[]) { new name[MAX_PLAYER_NAME]; new target=playerid; if(!isnull(params)) sscanf(params, "r", target); GetPlayerName(target, name, sizeof(name)); if(sscanf(params,"d",target)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /stats <ID>"); if (!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected."); new string[128]; new Float:ratio=floatdiv(PlayerInfo[target][pKills], PlayerInfo[target][pDeaths]); format(string, 128, "%d %d %.2f", PlayerInfo[target][pKills], PlayerInfo[target][pDeaths], ratio); format(string, sizeof(string), "Name: %s (ID:%d)\nAdmin Level :%d\nKills : %d\nDeaths : %d\nKill/Death Ratio: %.2f\nScore: %d",name, target, PlayerInfo[target][pAdmin], PlayerInfo[target][pKills], PlayerInfo[target][pDeaths], ratio,PlayerInfo[target][pScore]); ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"Player Stats",string,"Close",""); return 1; }
Код:
if(sscanf(params,"d",id)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /stats <ID>"); Код:
if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /stats <ID>"); |