PDA

View Full Version : Problem with /stats as dialog


RedWolfX
10/06/2013, 11:09 PM
Hello, I am converting my /stats command to dialogs, but it just shows the end of stats.

This is my code:


new string2[128];
new coordsstring[128];
new skin = PlayerInfo[playerid][pSkin];
new time = PlayerInfo[playerid][pPlayTime];
new alevel = PlayerInfo[playerid][pAdmin];
new respect = PlayerInfo[playerid][pRespect];
new level = PlayerInfo[playerid][pScore];
new pmember = PlayerInfo[playerid][pFaction];
new pleader = PlayerInfo[playerid][pLeader];
new atext[20];
if(PlayerInfo[playerid][pMale] == 1) { atext = "Male"; }
else if(PlayerInfo[playerid][pFemale] == 1) { atext = "Female"; }
new ttext[20];
if(PlayerInfo[playerid][pSurvivors] == 1) { ttext = "Survivor"; }
else if(PlayerInfo[playerid][pOthers] == 1) { ttext = "The Others"; }
new stext[20];
if(PlayerInfo[playerid][pHunter] == 1) { stext = "Hunter"; }
else if(PlayerInfo[playerid][pDoctor] == 1) { stext = "Doctor"; }
else if(PlayerInfo[playerid][pDrugAddict] == 1) { stext = "Drug Addict"; }
else if(PlayerInfo[playerid][pThief] == 1) { stext = "Plunderer"; }
else if(PlayerInfo[playerid][pFisher] == 1) { stext = "Fisherman"; }
else if(PlayerInfo[playerid][pTech] == 1) { stext = "Technican"; }
else { stext = "None"; }
new ftext[20];
if(pmember == 1 || pleader == 1)
{ ftext = "TBWM"; }
else if(pmember == 2 || pleader == 2)
{ ftext = "The Rakyat"; }
else if(pmember == 3 || pleader == 3)
{ ftext = "The Regiment"; }
else if(pmember == 0 || pleader == 0)
{ ftext = "None"; }
new rtext[64];
format(rtext,sizeof(rtext),"%s",GetPlayerRank(playerid));
new vtext[20];
if(PlayerInfo[playerid][pVip] == 1) { vtext = "Bronze Vip"; }
else if(PlayerInfo[playerid][pVip] == 2) { vtext = "Silver Vip"; }
else if(PlayerInfo[playerid][pVip] == 3) { vtext = "Gold Vip"; }
else { vtext = "Regular Member"; }
new relation[20];
strmid(relation, PlayerInfo[playerid][pRelationWith], 0, strlen(PlayerInfo[playerid][pRelationWith]), 255);
if(PlayerInfo[playerid][pRelationShip] == 0) { relation = "None"; }
new name[MAX_PLAYER_NAME];
new Float:health;
GetPlayerHealth(playerid,health);
GetPlayerName(playerid, name, sizeof(name));
format(string2,sizeof(string2), "Name:[%s] Level:[%d] Sex:[%s] Health:[%.1f]",name,level,atext,health);
strcat(string2,coordsstring);
format(string2,sizeof(string2), "Team:[%s] Respect:[%d] Talent:[%s] Playerhours:[%d]",ttext,respect,stext,time);
strcat(string2,coordsstring);
format(string2,sizeof(string2), "Membership:[%s] Relationship:[%s] Skin:[%d] Admin Level:[%d]",vtext,relation,skin,alevel);
strcat(string2,coordsstring);
format(string2,sizeof(string2), "Faction:[%s] Rank:[%s]",ftext,rtext);
strcat(string2,coordsstring);
ShowPlayerDialog(playerid,STATS,DIALOG_STYLE_MSGBO X,"Stats",string2,"Close","");


It just shows Faction and rank. Why is that? Cant figure out why

rpg894
10/06/2013, 11:13 PM
what do you expect? In pawn language if you say a = 1, a = 2, a = 3, and then search for a, the a is 3. use strcut

Red_Dragon.
11/06/2013, 12:51 AM
I suggest using strcat in separate lines and keep enlarging the string size till it fits all the stats.