SA-MP Forums Archive
Several of warnings and errors - again - 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: Several of warnings and errors - again (/showthread.php?tid=593519)



Several of warnings and errors - again - Kraff - 06.11.2015

I've re-written a register & login system, I literally re-wrote everything and I still receive error messages.

Now, after fixing all the previous errors on my previous thread I receive 3 errors + fatal error due to many errors in one line.

Code:
(119) : error 001: expected token: "-string end-", but found "-identifier-"
(119) : error 029: invalid expression, assumed zero
(119) : warning 215: expression has no effect
(119) : warning 215: expression has no effect
(119) : warning 215: expression has no effect
(119) : error 001: expected token: ";", but found ")"
(119) : fatal error 107: too many error messages on one line
Here's line 119:

Code:
	    else
	    {
         ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...".""COL_WHITE"Please inset a password to register.","Register","Quit");
         return 1;
		}
Here's the rest of the code:
Code:
public OnPlayerConnect(playerid)
{
	if(fexist(UserPath(playerid)))
	{
	    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
	    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password to login.","Login","Quit");
	    }
	    else
	    {
         ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...".""COL_WHITE"Please inset a password to register.","Register","Quit");
         return 1;
		}
		return 1;
}



Re: Several of warnings and errors - again - AbyssMorgan - 06.11.2015

PHP Code:
 ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT,"{FFFFFF}Registering....Please inset a password to register.","Register","Quit"); 



Re: Several of warnings and errors - again - SMCentral - 15.06.2016

Quote:
Originally Posted by Kraff
View Post
I've re-written a register & login system, I literally re-wrote everything and I still receive error messages.

Now, after fixing all the previous errors on my previous thread I receive 3 errors + fatal error due to many errors in one line.

Code:
(119) : error 001: expected token: "-string end-", but found "-identifier-"
(119) : error 029: invalid expression, assumed zero
(119) : warning 215: expression has no effect
(119) : warning 215: expression has no effect
(119) : warning 215: expression has no effect
(119) : error 001: expected token: ";", but found ")"
(119) : fatal error 107: too many error messages on one line
Here's line 119:

Code:
	    else
	    {
         ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...".""COL_WHITE"Please inset a password to register.","Register","Quit");
         return 1;
		}
Here's the rest of the code:
Code:
public OnPlayerConnect(playerid)
{
	if(fexist(UserPath(playerid)))
	{
	    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
	    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password to login.","Login","Quit");
	    }
	    else
	    {
         ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...".""COL_WHITE"Please inset a password to register.","Register","Quit");
         return 1;
		}
		return 1;
}
I believe this is what you are looking for. Use '\n' to declare a new line. Use {} with just the colour hex inside them to colour a string ie. {FFFFFF}Hello {000000}World (colours hello white, world black). I also fixed the 'inset' spelling mistake to 'insert' for you.

Quote:

ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "{FFFFFF}Registering...\n\nPlease insert a password to register.", "Register", "Quit");

Alternatively, what you can do is:

Quote:

#define STRING_WHITE_COLOUR "{FFFFFF}"

ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""STRING_WHITE_COLOUR"Registering...\n\nPlease insert a password to register.", "Register", "Quit");

I hope this helps you in your endeavours.


Re: Several of warnings and errors - again - Konstantinos - 15.06.2016

Just to clarify why those error were given.

COL_WHITE is defined as an integer and not as it should be (a string):
pawn Code:
#define COL_WHITE "{FFFFFF}"