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



error 001: expected token: "-string end-", but found "-identifier-" - LocMax - 01.02.2014

Код:
public OnPlayerConnect(playerid)
{
    new Query[250], DBResult:Result;
    format(Query, sizeof(Query), "SELECT `NAME` FROM `BANNED` WHERE `NAME` = '%s' COLLATE NOCASE", DB_Escape(PlayerName(playerid)));
    Result = db_query(BFU, Query);
    if(db_num_rows(Result))
    {
        ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Ban has been detected", "Our system has detected that your name was banned.\nIf you think this is an error or mistake, visit our website.\n"WEBSITE"", "Okay", "");
        printf("%s has been kicked from OnPlayerConnect - Username ban detection", PlayerName(playerid));
		KickEx(playerid);
	}
	else
	{
	    format(Query, sizeof(Query), "SELECT `IP` FROM `BANNED` WHERE `IP` = '%s' COLLATE NOCASE", DB_Escape(PlayerIP(playerid)));
    	Result = db_query(BFU, Query);
    	if(db_num_rows(Result))
    	{
    	    ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Ban has been detected", "Our system has detected that your IP was banned.\nIf you think this is an error or mistake, visit our website.\n"WEBSITE"", "Okay", "");
	        printf("%s has been kicked from OnPlayerConnect - IP ban detection", PlayerName(playerid));
	        KickEx(playerid);
    	}
    	else
    	{
    	    format(Query, sizeof(Query), "SELECT `NAME` FROM `USERS` WHERE `NAME` = '%s' COLLATE NOCASE", DB_Escape(PlayerName(playerid)));
    		Result = db_query(BFU, Query);
    		if(db_num_rows(Result))
    		{
        		ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Log-in is required", "Hello user!\nYour name has been detected as registered.\nYou are now required to log-in.\n"GREEN"Enter your password below to continue", "Login", "Leave");
    		}
    		else
    		{
        		ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Registration is required", "Hello user!\nYour name has been detected as not registered.\nYou are now required to register.\n"GREEN"Enter your password below to continue", "Register", "Leave");
    		}
    	}
	}
    db_free_result(Result);

	return 1;
}
What's wrong...?
The errors are wherever ShowPlayerDialog is.


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

pawn Код:
... \n"GREEN"Enter your ...
GREEN should be defined as:
pawn Код:
#define GREEN "{00FF00}"
instead of:
pawn Код:
#define GREEN 0x00FF00FF



Re: error 001: expected token: "-string end-", but found "-identifier-" - LocMax - 01.02.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
... \n"GREEN"Enter your ...
GREEN should be defined as:
pawn Код:
#define GREEN "{00FF00}"
instead of:
pawn Код:
#define GREEN 0x00FF00FF
Ohhhh yeah how could've I forgotten that :0
Thanks!