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=645565)



error 001: expected token: "-string end-", but found "-identifier-" - DonMonaco - 29.11.2017

Was trying something and I need help with some errors, those are the errors I get

Код:
C:\server\gamemodes\fortcarsonroleplay.pwn(16309) : error 001: expected token: "-string end-", but found "-identifier-"
C:\server\gamemodes\fortcarsonroleplay.pwn(16309) : warning 215: expression has no effect
C:\server\gamemodes\fortcarsonroleplay.pwn(16309) : error 001: expected token: ";", but found "-string-"
C:\server\gamemodes\fortcarsonroleplay.pwn(16309) : warning 215: expression has no effect
C:\server\gamemodes\fortcarsonroleplay.pwn(16309) : error 017: undefined symbol "pActiveOffense"
C:\server\gamemodes\fortcarsonroleplay.pwn(16309) : fatal error 107: too many error messages on one line
Код:
 format(string, sizeof(string), "[PD Database:] "COLOR_WHITE"%s", PlayerInfo[criminal][pActiveListings],string);
		SCM(playerid, COLOR_PD, string);



Re: error 001: expected token: "-string end-", but found "-identifier-" - Konstantinos - 29.11.2017

You cannot use integers in-between a string - you should have defined it as following:
pawn Код:
#define COL_WHITE "{FFFFFF}"
and use COL_WHITE instead. But there is a problem, you have 1 specifier (%s) and 2 arguments (PlayerInfo[criminal][pActiveListings], string)

If you only want to concatenate the active listings and just that, you can also use:
pawn Код:
string = "[PD Database:] " COL_WHITE;
strcat(string, PlayerInfo[criminal][pActiveListings]);



Re: error 001: expected token: "-string end-", but found "-identifier-" - ATomas - 29.11.2017

" missing

#define COLOR_WHITE "{FFFFFF}"

format(string, sizeof(string), "[PD Database:] "COLOR_WHITE""%s", PlayerInfo[criminal][pActiveListings],string);