#1

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?
Reply
#2

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;
}
Reply
#3

No, it says 0 in everything.
Reply
#4

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!
Reply
#5

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;
}
Reply
#6

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.
Reply
#7

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

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
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)