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



error 001: expected token: ";", but found "-string-" - D3vin - 13.10.2013

I keep getting this errors
Код:
error 001: expected token: "-string end-", but found "-identifier-"
error 001: expected token: ";", but found "-string-"
warning 215: expression has no effect
for the following line

Код:
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_WHITE"Login",""COLOR_WHITE"Type your password below to login.","Login","Quit");
any suggestions/help for this im stuck and have a feeling I need strcmp, don't not sure how I would use it


Re: error 001: expected token: ";", but found "-string-" - DanishHaq - 13.10.2013

Show us 2-3 lines before that line and 2-3 lines after that line.

EDIT: Before you do that, look at the post below first.


Re: error 001: expected token: ";", but found "-string-" - Konstantinos - 13.10.2013

If the color is defined as:
pawn Код:
#define COLOR_WHITE 0xFFFFFFFF
is wrong and it will give the errors. It should be:
pawn Код:
#define COLOR_WHITE "{FFFFFF}"



Re: error 001: expected token: ";", but found "-string-" - D3vin - 13.10.2013

Код:
public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_WHITE"Login",""COLOR_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}
theres the whole public


Re: error 001: expected token: ";", but found "-string-" - D3vin - 13.10.2013

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
If the color is defined as:
pawn Код:
#define COLOR_WHITE 0xFFFFFFFF
is wrong and it will give the errors. It should be:
pawn Код:
#define COLOR_WHITE "{FFFFFF}"
I tried that but I only got more errors


Re: error 001: expected token: ";", but found "-string-" - Tomix - 13.10.2013

try this
Код:
public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_WHITE"Login",""COLOR_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COLOR_WHITE"Registering...",""COLOR_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}



Re: error 001: expected token: ";", but found "-string-" - Konstantinos - 13.10.2013

Quote:
Originally Posted by D3vin
Посмотреть сообщение
I tried that but I only got more errors
The correct method is the last one I said. Although, you can use the most common one.

pawn Код:
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{FFFFFF}Login","{FFFFFF}Type your password below to login.","Login","Quit");



Re: error 001: expected token: ";", but found "-string-" - D3vin - 13.10.2013

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The correct method is the last one I said. Although, you can use the most common one.

pawn Код:
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{FFFFFF}Login","{FFFFFF}Type your password below to login.","Login","Quit");
Thanks for your help, I just got it to work!