[HELP] showplayerdialog
#1

Here is my code :

Код:
CMD:statses(playerid, params[]) 
{	
	new codordsstring[768];
	new recodordsstring[768];
	new health = PlayerInfo[playerid][pHealth];
	new armor = PlayerInfo[playerid][pArmor];
	new cash = GetPlayerCash(playerid);
	new sext = PlayerInfo[playerid][pSex];
	new job1 = PlayerInfo[playerid][pJob];
	new job2 = PlayerInfo[playerid][pJob2];
	new jlevel = PlayerInfo[playerid][pJob];
	new jlevel2 = PlayerInfo[playerid][pJob2];
	new married = PlayerInfo[playerid][pMarriedTo];
	new insur = PlayerInfo[playerid][pInsurance];
	new upgradep = PlayerInfo[playerid][gPupgrade];
	new age = PlayerInfo[playerid][pAge];
	new ptime = PlayerInfo[playerid][pConnectTime];
	new account = PlayerInfo[playerid][pAccount];
	new nxtlevel = PlayerInfo[playerid][pLevel]+1;
	new exp = PlayerInfo[playerid][pExp];
	new expamount = nxtlevel*levelexp;
	new costlevel = nxtlevel*levelcost;
	new drank = PlayerInfo[playerid][pDonateRank];
	new level = PlayerInfo[playerid][pLevel];
	new totalwealth = account + cash;
	format(codordsstring, sizeof(codordsstring),"{0xFFFF00AA}VIP LEVEL: %s\r\n{FFFFFF}Level: %d\r\n{FFFFFF}Gender: %s\r\n{FFFFFF}Age: %d\r\n{FFFFFF}Cash: %d\r\n{FFFFFF}Health: %d.1f\r\n{FFFFFF}Armor: %d.1f", drank,level,sext,age,totalwealth,health,armor);
	strcat(recodordsstring, codordsstring, sizeof(recodordsstring));
	format(codordsstring, sizeof(codordsstring),"\r\n{FFFFFF}Married to: %s\r\n{FFFFFF}Playing Hours: %d\r\n{FFFFFF}Upgrade Points: %d\r\n{FFFFFF}Next Level: %d/%d($%d)\r\n{FFFFFF}Job1: %s\r\n{FFFFFF}Job2: %s\r\n{FFFFFF}Insurance: %s\r\n", married,ptime,upgradep,exp,expamount,costlevel,job1,job2,insur);
	strcat(recodordsstring, codordsstring, sizeof(recodordsstring));
	ShowPlayerDialog(playerid, 3881, DIALOG_STYLE_MSGBOX, "STATS",codordsstring,"Next Page","Close");
	return 1;
	
}
When i recompile it there's no error pops up. But when i try it on game it shows this :



PLEASE HELP ME! Thank you
Reply
#2

Are you sure that PlayerInfo[playerid][pJob] is a string?
Reply
#3

Код:
job1 = PlayerInfo[playerid][pJob];
Maybe you're not in indetified job so the server couldn't load it name
Reply
#4

Here you give it an integer value;
pawn Код:
new job1 = PlayerInfo[playerid][pJob];
and here you give it a String value:
pawn Код:
\n{FFFFFF}Job1: %s\r\n
meaning if the script doesnt give any errors, it must be an integer.

try doing:
pawn Код:
\n{FFFFFF}Job1: %i\r\n
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)