Stats Dialog -
StR_MaRy - 15.12.2015
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);
Re: Stats Dialog -
zPain - 15.12.2015
PHP код:
new coordsstring[1024];
format(coordsstring, sizeof(coordsstring), "%s (%d)\n", GetName(targetid), targetid);
format(coordsstring, sizeof(coordsstring), "%sLevel:[%d] Sex:[%s] Age:[%d] Cash:[$%s] Bank:[$%s] PhoneNr.:[%s]\n", coordstring, level, sex, age, FormatNumber(cash), FormatNumber(account), PhoneFormat(phonenumber));
format(coordsstring, sizeof(coordsstring), "%sPremium Account:[%s] Next level:[$%s] Respect:[%d/%d] Hours played:[%d] Rob Points:[%d]\n", coordstring, premiumaccount, FormatNumber(costlevel), respect, respectneed, hours, rob);
format(coordsstring, sizeof(coordsstring), "%sCrimes:[%d] Arrests:[%d] Wanted Deaths:[%d] Jailed:[%s] AJail:[%s] Muted:[%s]\n", coordstring, crimes, arrests, wdeaths, jail, ajail, mute);
format(coordsstring, sizeof(coordsstring), "%sWanted level:[%d] Kills:[%d] Deaths:[%d] Drugs:[%d] Materials:[%d] Coins:[%d] %s\n",coordstring, wanted, kills, deaths, drugs, mats, coins, freepoints);
format(coordsstring, sizeof(coordsstring), "%sJob:[%s] Faction:[%s] Rank:[%s] FWarns:[%d/3] FPunish:[%d/20] Warns:[%d/3]\n", coordstring, jtext, FactionName[faction], rtext, fwarns, punish, warns);
ShowPlayerDialog(playerid,999,DIALOG_STYLE_MSGBOX,"Statistics:",coordsstring,"OK","");
Re: Stats Dialog -
TwinkiDaBoss - 15.12.2015
Here u go
PHP код:
CMD:stats(playerid,params[]) {
new coordsstring[1024],storage[128];
format(storage, sizeof(storage), "%s (%d)\n", GetName(targetid), targetid);
strcat(coordsstring,storage);
format(storage, sizeof(storage), "Level:[%d] Sex:[%s] Age:[%d] Cash:[$%s] Bank:[$%s] PhoneNr.:[%s]\n", level, sex, age, FormatNumber(cash), FormatNumber(account), PhoneFormat(phonenumber));
strcat(coordsstring,storage);
format(storage, sizeof(storage), "Premium Account:[%s] Next level:[$%s] Respect:[%d/%d] Hours played:[%d] Rob Points:[%d]\n", premiumaccount, FormatNumber(costlevel), respect, respectneed, hours, rob);
strcat(coordsstring,storage);
format(storage, sizeof(storage), "Crimes:[%d] Arrests:[%d] Wanted Deaths:[%d] Jailed:[%s] AJail:[%s] Muted:[%s]\n", crimes, arrests, wdeaths, jail, ajail, mute);
strcat(coordsstring,storage);
format(storage, sizeof(storage), "Wanted level:[%d] Kills:[%d] Deaths:[%d] Drugs:[%d] Materials:[%d] Coins:[%d] %s\n",wanted, kills, deaths, drugs, mats, coins, freepoints);
strcat(coordsstring,storage);
format(storage, sizeof(storage), "Job:[%s] Faction:[%s] Rank:[%s] FWarns:[%d/3] FPunish:[%d/20] Warns:[%d/3]\n", jtext, FactionName[faction], rtext, fwarns, punish, warns);
strcat(coordsstring,storage);
ShowPlayerDialog(playerid,999,DIALOG_STYLE_MSGBOX, "Statistics:",storage,"OK","");
return true;
}
Re: Stats Dialog -
FreAkeD - 15.12.2015
Also, remember that format is much slower than strcat. In this case, you should always use strcat.
Re: Stats Dialog -
StR_MaRy - 15.12.2015
thx you all , both work but i use zPain model , thx both again and u2 freaked for advice