/stats command error - help
#1

pawn Код:
CMD:stats(playerid,params[])
{
    new string2[200];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string2, sizeof(string2),"{FF0000}Name:               {15FF00}%s \n{FF0000}Player ID:          {15FF00}%d\n{FF0000}Kills:              {15FF00}%d\n{FF0000}Deaths:              {15FF00}%d", name, playerid, pInfo[playerid][pKills], pInfo[playerid][pDeaths]);
    /* Line 1796 >> */ strcat(string2, "{FF0000}Admin Level:         {15FF00}%d\n{FF0000}Admin Rank:         {15FF00}%s\n{FF0000}Scores:             {15FF00}%d\n{FF0000}Money/Cash:         {15FF00}%d", pInfo[playerid][pAdmin], GetAdminRank(playerid), GetPlayerScore(playerid), GetPlayerCash(playerid));
    ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"{15FF00}Account Statistic",string2,"Close","");
    return 1;
}
pawn Код:
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",pInfo[playerid][pPass]);
    INI_Int("Cash",pInfo[playerid][pCash]);
    INI_Int("Admin",pInfo[playerid][pAdmin]);
    INI_Int("Kills",pInfo[playerid][pKills]);
    INI_Int("Deaths",pInfo[playerid][pDeaths]);
    INI_Int("Scores",pInfo[playerid][pScores]);
    return 1;
}
Error:
(1796) : warning 202: number of arguments does not match definition
(1796) : warning 202: number of arguments does not match definition
(1796) : warning 202: number of arguments does not match definition
Reply
#2

Use like this -
pawn Код:
CMD:stats(playerid,params[])
{
    new string2[200], temp[100];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(string2, sizeof(string2),"{FF0000}Name:               {15FF00}%s \n{FF0000}Player ID:          {15FF00}%d\n{FF0000}Kills:              {15FF00}%d\n{FF0000}Deaths:              {15FF00}%d", name, playerid, pInfo[playerid][pKills], pInfo[playerid][pDeaths]);
    format(temp, sizeof(temp), "{FF0000}Admin Level:         {15FF00}%d\n{FF0000}Admin Rank:         {15FF00}%s\n{FF0000}Scores:             {15FF00}%d\n{FF0000}Money/Cash:         {15FF00}%d", pInfo[playerid][pAdmin], GetAdminRank(playerid), GetPlayerScore(playerid), GetPlayerCash(playerid));
    strcat(string2, temp);
    ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,"{15FF00}Account Statistic",string2,"Close","");
    return 1;
}
strcat joins two strings, it doesn't format it
And use \t instead of long space, \t is more accurate and faster method to give a equal space so that text appear aligned, you can ****** to see affect of \t
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)