SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 10/06/2013, 11:09 PM   #1
RedWolfX
Big Clucker
 
RedWolfX's Avatar
 
Join Date: Jul 2012
Location: Sweden
Posts: 127
Reputation: 20
Default Problem with /stats as dialog

Hello, I am converting my /stats command to dialogs, but it just shows the end of stats.

This is my code:

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_MSGBOX,"Stats",string2,"Close","");
It just shows Faction and rank. Why is that? Cant figure out why
RedWolfX is offline   Reply With Quote
Old 10/06/2013, 11:13 PM   #2
rpg894
Little Clucker
 
Join Date: Apr 2013
Posts: 12
Reputation: -23
Default Re: Problem with /stats as dialog

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
rpg894 is offline   Reply With Quote
Old 11/06/2013, 12:51 AM   #3
Red_Dragon.
High-roller
 
Red_Dragon.'s Avatar
 
Join Date: Sep 2012
Posts: 1,391
Reputation: 46
Default Re: Problem with /stats as dialog

I suggest using strcat in separate lines and keep enlarging the string size till it fits all the stats.
Red_Dragon. is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stats in dialog Squirrel Scripting Help 6 25/03/2013 04:15 AM
/stats with dialog help help !!! nguyenquynh Scripting Help 3 05/02/2013 04:46 PM
Dialog stats kujox222 Scripting Help 2 16/06/2012 09:33 AM
/stats dialog problem.. qUick1337 Help Archive 10 17/03/2011 05:29 PM
[Help] Stats in Dialog Equilibrium Help Archive 7 22/10/2010 12:37 PM


All times are GMT. The time now is 05:57 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.