[HELP] /stats command
#1

Hey everyone, stats command work except name , it always says same wrong name on different players.
Anyone know how to fix it?

pawn Код:
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;
}
Reply


Messages In This Thread
[HELP] /stats command - by NeamPojma - 22.06.2015, 20:01
Re: [HELP] /stats command - by justice96 - 22.06.2015, 20:06
Re: [HELP] /stats command - by Konstantinos - 22.06.2015, 20:07
Re: [HELP] /stats command - by kalanerik99 - 22.06.2015, 20:08
Re: [HELP] /stats command - by NeamPojma - 22.06.2015, 20:15
Re: [HELP] /stats command - by kalanerik99 - 22.06.2015, 20:20
Re: [HELP] /stats command - by NeamPojma - 22.06.2015, 20:25
Re: [HELP] /stats command - by Prokill911 - 22.06.2015, 20:40
Re: [HELP] /stats command - by justice96 - 22.06.2015, 20:49

Forum Jump:


Users browsing this thread: 3 Guest(s)