07.02.2018, 11:10
It's because you've assigned your own ID (playerid), instead it should've been the specified (id) like this:
I'd also suggest to check if IsPlayerConnected(id) and return an error message if it's false.
Код:
CMD:stats(playerid, params[]) { if(connected[playerid] == true) return GameTextForPlayer(playerid, "~r~Spawn First", 5000, 5); new id; if(sscanf(params, "u", id)) return SendClientMessage(, -1, "{c3c3c3}(INFO) /stats [id]"); SendClientMessage(playerid, -1, "{CECEF6}* You are viewing /stats."); new string[900], stats[900],str[129], name[MAX_PLAYER_NAME]; GetPlayerName(id, name, sizeof(name)); format(str, sizeof(str), "{4286f4}Player name {FFFFFF}%s {4286f4}database id {FFFFFF}%i\n\n", name, pInfo[id][ID]); strcat(stats, str); format(string, sizeof(string), "{4286f4}Admin Level: ( {FFFFFF}%i {4286f4})\n", pInfo[id][Admin]); strcat(stats, string); format(string, sizeof(string), "{4286f4}Score: ( {FFFFFF}%i {4286f4})\n", pInfo[id][Score]); strcat(stats, string); format(string, sizeof(string), "{4286f4}Points: ( {FFFFFF}%i {4286f4})\n", pInfo[id][Points]); strcat(stats, string); format(string, sizeof(string), "{4286f4}Respect: ( {FFFFFF}%i {4286f4})\n", pInfo[id][Respect]); strcat(stats, string); format(string, sizeof(string), "{4286f4}Kills: ( {FFFFFF}%i {4286f4})\n", pInfo[id][Kills]); strcat(stats, string); format(string, sizeof(string), "{4286f4}Deaths: ( {FFFFFF}%i {4286f4})\n", pInfo[id][Deaths]); strcat(stats, string); format(string, sizeof(string), "{4286f4}Ratio K/D: ( {FFFFFF}%.2f {4286f4})\n", floatdiv(pInfo[id][Kills], pInfo[id][Deaths])); strcat(stats, string); ShowPlayerDialog(playerid, 55, DIALOG_STYLE_MSGBOX, "STATS", stats, "Ok", ""); return 1; }