Stats Dialog
#1

hi guys i did this if is something wrong can some1 help me ?

Код HTML:
new coordsstring[1024];
		format(coordsstring, sizeof(coordsstring), "%s (%d)\n", GetName(targetid), targetid);
		format(coordsstring, sizeof(coordsstring), "Level:[%d] Sex:[%s] Age:[%d] Cash:[$%s] Bank:[$%s] PhoneNr.:[%s]\n", level, sex, age, FormatNumber(cash), FormatNumber(account), PhoneFormat(phonenumber));
		format(coordsstring, sizeof(coordsstring), "Premium Account:[%s] Next level:[$%s] Respect:[%d/%d] Hours played:[%d] Rob Points:[%d]\n", premiumaccount, FormatNumber(costlevel), respect, respectneed, hours, rob);
		format(coordsstring, sizeof(coordsstring), "Crimes:[%d] Arrests:[%d] Wanted Deaths:[%d] Jailed:[%s] AJail:[%s] Muted:[%s]\n", crimes, arrests, wdeaths, jail, ajail, mute);
		format(coordsstring, sizeof(coordsstring), "Wanted level:[%d] Kills:[%d] Deaths:[%d] Drugs:[%d] Materials:[%d] Coins:[%d] %s\n",wanted, kills, deaths, drugs, mats, coins, freepoints);
		format(coordsstring, sizeof(coordsstring), "Job:[%s] Faction:[%s] Rank:[%s] FWarns:[%d/3] FPunish:[%d/20] Warns:[%d/3]\n", jtext, FactionName[faction], rtext, fwarns, punish, warns);
		ShowPlayerDialog(playerid,999,DIALOG_STYLE_MSGBOX,"Statistics:",coordsstring,"OK","");
but it shows me only the last line

Код HTML:
format(coordsstring, sizeof(coordsstring), "Job:[%s] Faction:[%s] Rank:[%s] FWarns:[%d/3] FPunish:[%d/20] Warns:[%d/3]\n", jtext, FactionName[faction], rtext, fwarns, punish, warns);
Reply
#2

PHP код:
new coordsstring[1024];
format(coordsstringsizeof(coordsstring), "%s (%d)\n"GetName(targetid), targetid);
format(coordsstringsizeof(coordsstring), "%sLevel:[%d] Sex:[%s] Age:[%d] Cash:[$%s] Bank:[$%s] PhoneNr.:[%s]\n"coordstringlevelsexageFormatNumber(cash), FormatNumber(account), PhoneFormat(phonenumber));
format(coordsstringsizeof(coordsstring), "%sPremium Account:[%s] Next level:[$%s] Respect:[%d/%d] Hours played:[%d] Rob Points:[%d]\n"coordstringpremiumaccountFormatNumber(costlevel), respectrespectneedhoursrob);
format(coordsstringsizeof(coordsstring), "%sCrimes:[%d] Arrests:[%d] Wanted Deaths:[%d] Jailed:[%s] AJail:[%s] Muted:[%s]\n"coordstringcrimesarrestswdeathsjailajailmute);
format(coordsstringsizeof(coordsstring), "%sWanted level:[%d] Kills:[%d] Deaths:[%d] Drugs:[%d] Materials:[%d] Coins:[%d] %s\n",coordstringwantedkillsdeathsdrugsmatscoinsfreepoints);
format(coordsstringsizeof(coordsstring), "%sJob:[%s] Faction:[%s] Rank:[%s] FWarns:[%d/3] FPunish:[%d/20] Warns:[%d/3]\n"coordstringjtextFactionName[faction], rtextfwarnspunishwarns);
ShowPlayerDialog(playerid,999,DIALOG_STYLE_MSGBOX,"Statistics:",coordsstring,"OK",""); 
Reply
#3

Here u go
PHP код:
CMD:stats(playerid,params[]) {
    new 
coordsstring[1024],storage[128];
    
format(storagesizeof(storage), "%s (%d)\n"GetName(targetid), targetid);
    
strcat(coordsstring,storage);

    
format(storagesizeof(storage), "Level:[%d] Sex:[%s] Age:[%d] Cash:[$%s] Bank:[$%s] PhoneNr.:[%s]\n"levelsexageFormatNumber(cash), FormatNumber(account), PhoneFormat(phonenumber));
    
strcat(coordsstring,storage);

    
format(storagesizeof(storage), "Premium Account:[%s] Next level:[$%s] Respect:[%d/%d] Hours played:[%d] Rob Points:[%d]\n"premiumaccountFormatNumber(costlevel), respectrespectneedhoursrob);
    
strcat(coordsstring,storage);

    
format(storagesizeof(storage), "Crimes:[%d] Arrests:[%d] Wanted Deaths:[%d] Jailed:[%s] AJail:[%s] Muted:[%s]\n"crimesarrestswdeathsjailajailmute);
    
strcat(coordsstring,storage);
    
    
format(storagesizeof(storage), "Wanted level:[%d] Kills:[%d] Deaths:[%d] Drugs:[%d] Materials:[%d] Coins:[%d] %s\n",wantedkillsdeathsdrugsmatscoinsfreepoints);
    
strcat(coordsstring,storage);
    
    
format(storagesizeof(storage), "Job:[%s] Faction:[%s] Rank:[%s] FWarns:[%d/3] FPunish:[%d/20] Warns:[%d/3]\n"jtextFactionName[faction], rtextfwarnspunishwarns);
    
strcat(coordsstring,storage);
    
    
ShowPlayerDialog(playerid,999,DIALOG_STYLE_MSGBOX"Statistics:",storage,"OK","");
    return 
true;

Reply
#4

Also, remember that format is much slower than strcat. In this case, you should always use strcat.
Reply
#5

thx you all , both work but i use zPain model , thx both again and u2 freaked for advice
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)