[HELP]/stats Message box - 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: [HELP]/stats Message box (
/showthread.php?tid=611313)
[HELP]/stats Message box -
masterwer - 04.07.2016
This is my code and I want do show player stats Message box. This is the code:
PHP код:
stock ShowStats(playerid, user)
{
new string[256], gender[8], famed[12], helper[12], vip[12], Float:H, Float:A, ogate1[8], ogate2[8], gate3[8], beta[12];
// Gender
if(Player[user][pGender] == 1) format(gender, sizeof(gender), "Male");
else if(Player[user][pGender] == 2) format(gender, sizeof(gender), "Female");
// Helper
if(Player[user][pHelper]) format(helper, sizeof(helper), "{00FF00}Yes");
else if(!Player[user][pHelper]) format(helper, sizeof(helper), "{00FF00}No");
// Famed
if(Player[user][pFamed]) format(famed, sizeof(famed), "{FF9900}Yes");
else if(!Player[user][pFamed]) format(famed, sizeof(famed), "{FF9900}No");
// VIP
if(Player[user][pVIP]) format(vip, sizeof(vip), "{C93CCE}Yes");
else if(!Player[user][pVIP]) format(vip, sizeof(vip), "{C93CCE}No");
// Beta Tester
if(Player[user][pTester]) format(beta, sizeof(beta), "{FFFF00}Yes");
else if(!Player[user][pTester]) format(beta, sizeof(beta), "{FFFF00}No");
// Gates
if(Player[user][pGate][0]) format(ogate1, sizeof(ogate1), "Yes");
else if(!Player[user][pGate][0]) format(ogate1, sizeof(ogate1), "None");
if(Player[user][pGate][1]) format(ogate2, sizeof(ogate2), "Yes");
else if(!Player[user][pGate][1]) format(ogate2, sizeof(ogate2), "None");
if(Player[user][pGate][2]) format(gate3, sizeof(gate3), "Yes");
else if(!Player[user][pGate][2]) format(gate3, sizeof(gate3), "None");
// Respect points and next level
new exp = Player[user][pExp];
new nxtlevel = Player[user][pLevel]+1;
new expamount = nxtlevel*4;
new costlevel = nxtlevel*2000;
// Health and Armor
GetPlayerHealth(user, H); GetPlayerArmour(user, A);
Please help me. I have tryed a lot to make a Messagebox like this but every times I've failed :
Sorry for bad English
PLZ help m !
Re: [HELP]/stats Message box -
Dayrion - 05.07.2016
You have to use strcat with a global string and a string while be formated each line. Don't forget to use '\n'
Re: [HELP]/stats Message box -
Maximun - 05.07.2016
PHP код:
new StatsMenu[120], DialogStats[64]; //Don't forget to increase the value of the string 'StatsMenu[The value]'
strcat(StatsMenu, "---------------------------------------------");
format(StatsMenu, sizeof(StatsMenu), "%sRank VIP(with string)\n", StatsMenu, string(here); //e.g: Gold VIP, make it with a string
format(StatsMenu, sizeof(StatsMenu), "%s{FFFFFF}Level: %d\n", StatsMenu, Player[user][pLevel]);
format(StatsMenu, sizeof(StatsMenu), "%s{FFFFFF}Gender: %s\n", StatsMenu, gender);
format(StatsMenu, sizeof(StatsMenu), "%s{FFFFFF}Date of Birth: %d\n", StatsMenu, Player[user][pDateBirth]); //Continue like this ..
strcat(StatsMenu, "---------------------------------------------");
format(DialogStats, sizeof(DialogStats), "Showing Statistics of %s", Get the name of the player);
ShowPlayerDialog(playerid, idDialog, DIALOG_STYLE_MSGBOX, DialogStats, StatsMenu, "Next Page", "Close");