01.05.2017, 19:51
Can someone tell me why this /stats cmd doesnt work?
I only get "You can also do /stats playername/id to check other player's stats." message.
This is ShowStats stock:
pawn Код:
CMD:stats(playerid, params[])
{
new id;
sscanf(params, "u", id);
SendClientMessage(playerid,0xFF0000FF, "* You can also do /stats playername/id to check other player's stats.");
if (isnull(params))
{
ShowStats(playerid);
}
else if(IsPlayerConnected(id))
{
ShowStats(id);
}
else SendClientMessage(playerid,COLOR_RED,"* Player is not connected.");
return true;
}
This is ShowStats stock:
pawn Код:
stock ShowStats(playerid)
{
new temp[1000];
new info[1000];
format(temp, sizeof(temp), "Kills: %d\n",Player[playerid][Kills]);
strcat(info, temp);
format(temp, sizeof(temp), "Deaths %d\n",Player[playerid][Deaths]);
strcat(info, temp);
format(temp, sizeof(temp), "Score: %i\n",GetPlayerScore(playerid));
strcat(info, temp);
return 1;
}