error 001: expected token: "-string end-", but found "-identifier-"
#1

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"));
Reply
#2

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

//Right
something ? ("Yes") : ("No")
Reply
#3

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
Reply
#4

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.
Reply
#5

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

Read about format() and strcat().
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)