SA-MP Forums Archive
stats - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: stats (/showthread.php?tid=366957)



stats - tyler12 - 08.08.2012

This command puts '0' in all places of the numbers in the dialog.

pawn Код:
CMD:stats(playerid,params[])
{
    new kills = pInfo[playerid][Kills],deaths = pInfo[playerid][Deaths],alevel = pInfo[playerid][Adminlevel],vlevel = pInfo[playerid][VIPlevel],score = pInfo[playerid][Scores],cash = pInfo[playerid][Money],string1[124],string2[500];
    format(string1,sizeof(string1),"%s stats",GetName(playerid));
    format(string2,sizeof(string2),"Kills: %d \t\t\t\t\tDeaths: %d\nAdmin level: %d \t\t\tVIP level: %d\nMoney: $%d \t\t\t\tScore: %d",kills,deaths,alevel,vlevel,score,cash);
    ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,string1,string2,"Close","");
    return 1;
}
Any help please?


Re: stats - kaiks - 08.08.2012

You've switched cash and score, maybe this was the problem,
try this

pawn Код:
CMD:stats(playerid,params[])
{
    new kills = pInfo[playerid][Kills], deaths = pInfo[playerid][Deaths], alevel = pInfo[playerid][Adminlevel], vlevel = pInfo[playerid][VIPlevel], score = pInfo[playerid][Scores], cash = pInfo[playerid][Money], string1[124], string2[500];
    format(string1,sizeof(string1),"%s stats",GetName(playerid));
    format(string2,sizeof(string2),"Kills: %d \t\t\t\t\tDeaths: %d\nAdmin level: %d \t\t\tVIP level: %d\nMoney: $%d \t\t\t\tScore: %d",kills,deaths,alevel,vlevel, cash, score);
    ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX,string1,string2,"Close","");
    return 1;
}



Re: stats - tyler12 - 08.08.2012

No, it says 0 in everything.


Re: stats - Revo - 08.08.2012

Does it contain any value? Try debugging with printf("Alelve: %d", pInfo[playerid][Adminlevel]);, If it's empty, it obviously doesn't contain any value!


Re: stats - kaiks - 08.08.2012

This:

pawn Код:
CMD:stats(playerid,params[])
{
    new kills = pInfo[playerid][Kills], deaths = pInfo[playerid][Deaths], alevel = pInfo[playerid][Adminlevel], vlevel = pInfo[playerid][VIPlevel], score = pInfo[playerid][Scores], cash = pInfo[playerid][Money], string[126];
    format(string,sizeof(string),"%s stats",GetName(playerid));
    format(string,sizeof(string),"Kills: %d \t\t\t\t\tDeaths: %d\nAdmin level: %d \t\t\tVIP level: %d\nMoney: $%d \t\t\t\tScore: %d",kills,deaths,alevel,vlevel, cash, score);
    ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX, string,"Close","");
    return 1;
}



Re: stats - tyler12 - 08.08.2012

Quote:
Originally Posted by kaiks
Посмотреть сообщение
This:

pawn Код:
CMD:stats(playerid,params[])
{
    new kills = pInfo[playerid][Kills], deaths = pInfo[playerid][Deaths], alevel = pInfo[playerid][Adminlevel], vlevel = pInfo[playerid][VIPlevel], score = pInfo[playerid][Scores], cash = pInfo[playerid][Money], string[126];
    format(string,sizeof(string),"%s stats",GetName(playerid));
    format(string,sizeof(string),"Kills: %d \t\t\t\t\tDeaths: %d\nAdmin level: %d \t\t\tVIP level: %d\nMoney: $%d \t\t\t\tScore: %d",kills,deaths,alevel,vlevel, cash, score);
    ShowPlayerDialog(playerid,DIALOG_STATS,DIALOG_STYLE_MSGBOX, string,"Close","");
    return 1;
}
No, it dosent show the caption, adding it just does the same as orignaly.


Re: stats - mrsamp - 08.08.2012

Try using the whole pdata instead of the new. I used whole code and it worked.
pawn Код:
pInfo[playerid][Kills]



Re: stats - tyler12 - 08.08.2012

Quote:
Originally Posted by mrsamp
Посмотреть сообщение
Try using the whole pdata instead of the new. I used whole code and it worked.
pawn Код:
pInfo[playerid][Kills]
no it no work


Re: stats - mrsamp - 08.08.2012

Try using %i instead of %d I saw someone using %i for score. Give it a try!