Pawno compiler help
#1

I have made a stats command and when i add one more thing in stats like i add "Fighting style:" and try to compile so the pawno get stuck and does not respond
Reply
#2

Show us the code..
Reply
#3

Код:
CMD:stats(playerid,params[])
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	new freeroam = PlayerInfo[playerid][pKills];
	new total = PlayerInfo[playerid][pScore];
	new skin = GetPlayerSkin(playerid);
	new admin = PlayerInfo[playerid][pAdmin];
	new vip = PlayerInfo[playerid][pVip];
	new logged = PlayerInfo[playerid][pLogged];
	new ping = GetPlayerPing(playerid);
	new god = God[playerid];
	new fs = fs[playerid];
	new string1[900];

	format(string1, sizeof string1, ""COL_G"%s(%d)\n\n"COL_G"General\n"COL_W"Logged In: "COL_W"%d\n"COL_W"Admin: "COL_W"%d\n"COL_WHITE"VIP: "COL_W"%d\n\n\n"COL_G"Scores\n"COL_W"FreeRoam Score: "COL_W"%d\n"COL_W"Total Score: "COL_W"%d\n\n\n"COL_G"Game \n"COL_W"Ping: "COL_W"%i\n"COL_W"Godmod: "COL_W"%d\n"COL_W"Skin: "COL_W"%d", name,playerid,logged,admin,vip,freeroam,total,ping,god,skin);
	ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX,"{44A1D0}Your Account Stats{FFFFFF}:",string1,"Ok","");
        return 1;
}
Here you go
Reply
#4

Try removing all the color codes first, If then it compiles... Use different color codes.
Reply
#5

(Part of) The problem is conflicting use of quotes, on this line:
Код:
format(string1, sizeof string1, ""COL_G"%s(%d)\n\n"COL_G"General\n"COL_W"Logged In: "COL_W"%d\n"COL_W"Admin: "COL_W"%d\n"COL_WHITE"VIP: "COL_W"%d\n\n\n"COL_G"Scores\n"COL_W"FreeRoam Score: "COL_W"%d\n"COL_W"Total Score: "COL_W"%d\n\n\n"COL_G"Game \n"COL_W"Ping: "COL_W"%i\n"COL_W"Godmod: "COL_W"%d\n"COL_W"Skin: "COL_W"%d", name,playerid,logged,admin,vip,freeroam,total,ping,god,skin);
Simply put, you cant use double quotes within double quotes, the code wont know what you mean, close previous quote block, or start a new one?
You can possibly escape them though (usually a backslash infront of the offending characters) but cant find any info on that beeing supported, and not within reach of my dev machine that has pawno.

Simplest fix, replace the double quotes ( " )in your format string with single quotes ( ' )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)