1 error.
#1

Код:
: error 035: argument type mismatch (argument 3)
pawn Код:
COMMAND:mystats(playerid,params[])
{
    new str[600];
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    strcat(str,"{00FFFF}Username{EEEEEE}:%s\n\n",pName); // error line
    strcat(str,"{00FFFF}Cash{EEEEEE}:%s\n\n",PlayerInfo[playerid][pCash]);
    strcat(str,"{00FFFF}Score{EEEEEE}:%s\n\n",PlayerInfo[playerid][pScore]);
    strcat(str,"{00FFFF}Kills{EEEEEE}:%s\n\n",PlayerInfo[playerid][pKills]);
    strcat(str,"{00FFFF}Deaths{EEEEE}:%s\n\n,",PlayerInfo[playerid][pDeaths]);
    strcat(str,"{00FFFF}Admin Level{EEEEEE}:%s\n\n",PlayerInfo[playerid][pAdmin]);
    strcat(str,"{00FFFF}VIP Level{EEEEEE}:%s\n\n",PlayerInfo[playerid][pVIP]);
    ShowPlayerDialog(playerid,1909,DIALOG_STYLE_MSGBOX,"{00FFFF}Statistics",str,"OK","");
    return 1;
}
Why ?
Reply
#2

i think strcat can not use Params you must add it in Format like this:
PHP код:
new stats[256];
new 
thestats[256];
strcat(thestats,"{00FFFF}Username{EEEEEE}:%s\n\n");
strcat(thestats,"{00FFFF}Cash{EEEEEE}:%s\n\n");
format(statssizeof(stats), thetitle  ,pName,PlayerInfo[playerid][pCash]); 
Reply
#3

strcat is not format. The 3rd argument is strcat is the size of the array (which is 1st argument):
pawn Код:
format(str, sizeof (str),
    "{00FFFF}Username{EEEEEE}:%s\n\n{00FFFF}Cash{EEEEEE}:%s\n\n{00FFFF}Score{EEEEEE}:%s\n\n{00FFFF}Kills{EEEEEE}:%s\n\n",
    pName, PlayerInfo[playerid][pCash], PlayerInfo[playerid][pScore], PlayerInfo[playerid][pKills]);
format(str, sizeof (str),
    "%s{00FFFF}Deaths{EEEEE}:%s\n\n{00FFFF}Admin Level{EEEEEE}:%s\n\n{00FFFF}VIP Level{EEEEEE}:%s\n\n",
    str, PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pVIP]);
I used format twice and splitted the arguments because I've got the patch of Zeex and I won't get the error about long line.
Reply
#4

Use this for the others ,the same as this example
pawn Код:
format(str, sizeof(str), "%s", name);
Reply
#5

Thanks re kosta
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)