17.11.2013, 17:16
I'm trying to create a "stats" command
but i'm sadly getting this error:
I've tried changing the recievername to id, but it still gave me the error..
Looking from other topics(******), I'm guessing that I'm missing something somewhere..
pawn Код:
CMD:stats(playerid, params[]) {
new id;
new pname[MAX_PLAYER_NAME], recievername[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
GetPlayerName(id,recievername,sizeof(recievername));
if(sscanf(params, "u", 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];
format(string, sizeof(string), " | ..:: %s's stats ::.. |", pname);
SendClientMessage(playerid, COLOR_GREEN, string);
format(string, sizeof(string), "| ..:: Score: %d | Money: %d$ | Kills: %d | Deaths: %d ::.. |", GetPlayerScore(recievername), GetPlayerMoney(recievername), PlayerInfo[recievername][pKills], PlayerInfo[recievername][pDeaths]);
SendClientMessage(playerid, COLOR_GREEN, string);//Error line above this line.
return 1;
}
Код:
\test.pwn(2241) : error 035: argument type mismatch (argument 1)
Looking from other topics(******), I'm guessing that I'm missing something somewhere..