SA-MP Forums Archive
error 001: expected token: "-string end-", but found "-identifier-" - 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: error 001: expected token: "-string end-", but found "-identifier-" (/showthread.php?tid=640804)



error 001: expected token: "-string end-", but found "-identifier-" - RedGun2015 - 07.09.2017

Hello guys, i create on my server a Hud system but when i compile i get his error:

Код:
error 001: expected token: "-string end-", but found "-identifier-"
error 001: expected token: "-string end-", but found "-identifier-"
error 001: expected token: "-string end-", but found "-identifier-"
My script: https://pastebin.com/FTTzf4Jf

Line:
Код:
format(gString, 450, "HP Bar\t3+\t%s\n", ((PlayerInfo[playerid][pHud][0]) ? "enabled" : "disabled"));
    format(gString, 450, "Armour\t3+\t%s\n", ((PlayerInfo[playerid][pHud][1]) ? "enabled" : "disabled"));
    format(gString, 450, "FPS\t2+\t%s\n", ((PlayerInfo[playerid][pHud][2]) ? "enabled" : "disabled"));



Re: error 001: expected token: "-string end-", but found "-identifier-" - Misiur - 07.09.2017

This is a "bug" in the compiler.
pawn Код:
// Wrong
something ? "Yes" : "No"

//Right
something ? ("Yes") : ("No")



Re: error 001: expected token: "-string end-", but found "-identifier-" - oMa37 - 07.09.2017

Try this:

PHP код:
format(gString450"HP Bar\t3+\t%s\n"PlayerInfo[playerid][pHud][0] ? ("enabled") : ("disabled"));
                
format(gString450"Armour\t3+\t%s\n"PlayerInfo[playerid][pHud][1] ? ("enabled") : ("disabled"));
                
format(gString450"FPS\t2+\t%s\n"PlayerInfo[playerid][pHud][2] ? ("enabled") : ("disabled")); 
Edit: Misiur was faster than me. :c


Re: error 001: expected token: "-string end-", but found "-identifier-" - RedGun2015 - 07.09.2017

Thanks, it's working now.

I was looking in a tutorial on ******* and i did what the guys say in tutorial, but now i see he have ShowPlayerDialogEx not ShowPlayerDialog, i search for this function and I did not find it.

If someone have this function I'll be grateful to post here.


Re: error 001: expected token: "-string end-", but found "-identifier-" - Meller - 07.09.2017

I'm just gonna say it: don't watch that tutorial, your code makes no sense.

Read about format() and strcat().