16.02.2018, 20:05
PHP код:
CMD:stats(playerid, params[])
{
new id;
if(connected[playerid] == true) return GameTextForPlayer(playerid, "~r~Spawn First", 5000, 5);
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) The player is not connected!");
if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) /stats [id]");
{
new string[900], stats[900],str[129], iString[150];
format (iString, sizeof(iString), "{CECEF6}* You are viewing /stats of %s", PlayerName[playerid]);
SendClientMessage(playerid, -1, iString);
format(str, sizeof(str), "{FFFFFF}%s {4286f4}database id {FFFFFF}%i\n\n", PlayerName[id], 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, "Player statistics", stats, "Ok", "");
}
return 1;
}
Look's like the code is done correctly, do you guys got any ideas :&