ShowPlayerDialog help
#1

tried doing dialogs for the first time today, don't really use dialogs much but i've noticed having everything show up in the chat can be annoying, especially when you want to see the 30+ stats of a player.

I attempted a dialog, it compiled, but ingame it didn't work, would only show 2 lines then end.
Not sure whats up, i know i'm doing something wrong, just can't see where as i get no errors compiling.

PHP код:
CMD:stats(playerid,params[])
{
     new 
id;
     new 
PlayerName[MAX_PLAYER_NAME];
     
GetPlayerName(playeridPlayerNamesizeof(PlayerName));
     new 
string[50];
     
sscanf(params"u"id);
     if (
isnull(params))
     {
        
format(stringsizeof(string), "_Statistics for '%s'_"PlayerName);
        
SendClientMessage(playeridLIMEstring);
        
format(stringsizeof(string), "General Stats\n");
        
format(stringsizeof(string), "Money: %d\n"GetPlayerCash(playerid));
        
format(stringsizeof(string), "Score: $%d\n"GetPlayerScore(playerid));
        
format(stringsizeof(string), "Total Kills: %d\n"pInfo[playerid][pKills]);
        
format(stringsizeof(string), "Total Deaths: %d\n"pInfo[playerid][pDeaths]);
        
format(stringsizeof(string), "Moneybags Found: %0.2f\n"pInfo[playerid][pMoneyBags]);
        
format(stringsizeof(string), "Total Times Farted: %s\n"pInfo[playerid][pFarts]);
        
format(stringsizeof(string), "Spontaneous Combustions: %s\n"pInfo[playerid][pFartExp]);
        
format(stringsizeof(string), "Total Panadol Used: %s\n"pInfo[playerid][pPanadolUsed]);
        
format(stringsizeof(string), "Criminal Stats\n");
        
format(stringsizeof(string), "Total Players Robbed: %d\n"pInfo[playerid][pPlayerRobs]);
        
format(stringsizeof(string), "Total Times Robbed: %d\n"pInfo[playerid][pRobbedBy]);
        
format(stringsizeof(string), "Total 24/7s Robbed: %d\n"pInfo[playerid][p247Robs]);
        
format(stringsizeof(string), "Total Ammunations Robbed: %d\n"pInfo[playerid][pAmmuRobs]);
        
format(stringsizeof(string), "Total Banks Robbed: %d\n"pInfo[playerid][pBankRobs]);
        
format(stringsizeof(string), "Total Heists Done: %d\n"pInfo[playerid][pBankHeists]);
        
format(stringsizeof(string), "Total Times Jailed: %d\n"pInfo[playerid][pJails]);
        
format(stringsizeof(string), "Total Stars Attained: %d\n"pInfo[playerid][pStarsAtt]);
        
format(stringsizeof(string), "Total Drugs Purchased: %d\n"pInfo[playerid][pDrugsPurch]);
        
format(stringsizeof(string), "Total Drugs Sold: N/A\n");
        
format(stringsizeof(string), "Total Drugs Used: %d\n"pInfo[playerid][pDrugsUsed]);
        
format(stringsizeof(string), "[Police Stats]\n");
        
format(stringsizeof(string), "Total Arrests: %d\n"pInfo[playerid][pArrests]);
        
ShowPlayerDialog(playeridSTATS_DIALOGDIALOG_STYLE_MSGBOX"{FF6666}Player Stats for %s"PlayerName"Okay","");
     }
     else if(
IsPlayerConnected(id))
     {
        
format(stringsizeof(string), "_Statistics for '%s'_"PlayerName);
        
SendClientMessage(playeridLIMEstring);
        
format(stringsizeof(string), "General Stats\n");
        
format(stringsizeof(string), "Money: %d\n"GetPlayerCash(playerid));
        
format(stringsizeof(string), "Score: $%d\n"GetPlayerScore(playerid));
        
format(stringsizeof(string), "Total Kills: %d\n"pInfo[playerid][pKills]);
        
format(stringsizeof(string), "Total Deaths: %d\n"pInfo[playerid][pDeaths]);
        
format(stringsizeof(string), "Moneybags Found: %0.2f\n"pInfo[playerid][pMoneyBags]);
        
format(stringsizeof(string), "Total Times Farted: %s\n"pInfo[playerid][pFarts]);
        
format(stringsizeof(string), "Spontaneous Combustions: %s\n"pInfo[playerid][pFartExp]);
        
format(stringsizeof(string), "Total Panadol Used: %s\n"pInfo[playerid][pPanadolUsed]);
        
format(stringsizeof(string), "Criminal Stats\n");
        
format(stringsizeof(string), "Total Players Robbed: %d\n"pInfo[playerid][pPlayerRobs]);
        
format(stringsizeof(string), "Total Times Robbed: %d\n"pInfo[playerid][pRobbedBy]);
        
format(stringsizeof(string), "Total 24/7s Robbed: %d\n"pInfo[playerid][p247Robs]);
        
format(stringsizeof(string), "Total Ammunations Robbed: %d\n"pInfo[playerid][pAmmuRobs]);
        
format(stringsizeof(string), "Total Banks Robbed: %d\n"pInfo[playerid][pBankRobs]);
        
format(stringsizeof(string), "Total Heists Done: %d\n"pInfo[playerid][pBankHeists]);
        
format(stringsizeof(string), "Total Times Jailed: %d\n"pInfo[playerid][pJails]);
        
format(stringsizeof(string), "Total Stars Attained: %d\n"pInfo[playerid][pStarsAtt]);
        
format(stringsizeof(string), "Total Drugs Purchased: %d\n"pInfo[playerid][pDrugsPurch]);
        
format(stringsizeof(string), "Total Drugs Sold: N/A\n");
        
format(stringsizeof(string), "Total Drugs Used: %d\n"pInfo[playerid][pDrugsUsed]);
        
format(stringsizeof(string), "[Police Stats]\n");
        
format(stringsizeof(string), "Total Arrests: %d\n"pInfo[playerid][pArrests]);
        
ShowPlayerDialog(playeridSTATS_DIALOGDIALOG_STYLE_MSGBOX"{FF6666}Player Stats for %s"PlayerName"Okay","");
     }
     else 
SendClientMessage(playerid,RED,"[ERROR]: Player is not connected");
     return 
1;

Reply


Messages In This Thread
ShowPlayerDialog help - by tommzy09 - 26.05.2015, 01:06
Re: ShowPlayerDialog help - by LMaxCo - 26.05.2015, 01:41
Re: ShowPlayerDialog help - by LMaxCo - 26.05.2015, 01:45
Re: ShowPlayerDialog help - by tommzy09 - 26.05.2015, 02:09
Re: ShowPlayerDialog help - by Trucido - 26.05.2015, 02:14
Re: ShowPlayerDialog help - by LMaxCo - 26.05.2015, 02:16
Re: ShowPlayerDialog help - by tommzy09 - 26.05.2015, 02:17
Re: ShowPlayerDialog help - by Trucido - 26.05.2015, 02:33
Re: ShowPlayerDialog help - by tommzy09 - 26.05.2015, 02:41

Forum Jump:


Users browsing this thread: 1 Guest(s)