SA-MP Forums Archive
Expected token - Register Dialog - 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: Expected token - Register Dialog (/showthread.php?tid=396405)



Expected token - Register Dialog - Lz - 30.11.2012

pawn Код:
public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_data", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}
My code, And errors:

Код:
C:\Users\Scripting.Ash-PC\Desktop\Roleplay\gamemodes\roleplay.pwn(91) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Scripting.Ash-PC\Desktop\Roleplay\gamemodes\roleplay.pwn(91) : warning 215: expression has no effect
C:\Users\Scripting.Ash-PC\Desktop\Roleplay\gamemodes\roleplay.pwn(91) : error 001: expected token: ";", but found "-string-"
C:\Users\Scripting.Ash-PC\Desktop\Roleplay\gamemodes\roleplay.pwn(91) : warning 215: expression has no effect
C:\Users\Scripting.Ash-PC\Desktop\Roleplay\gamemodes\roleplay.pwn(91) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Scripting.Ash-PC\Desktop\Roleplay\gamemodes\roleplay.pwn(91) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: Expected token - Register Dialog - GiamPy. - 30.11.2012

pawn Код:
public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_data", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"{FFFFFF}Login","{FFFFFF}Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,"{FFFFFF}Registering...","{FFFFFF}Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}



Re: Expected token - Register Dialog - NumbSkull - 30.11.2012

what is COL_WHITE defined as? is it a color definition? only strings can be stuffed in like that like if
pawn Код:
#define COL_WHITE "poooooop"



Re: Expected token - Register Dialog - Lz - 30.11.2012

Quote:
Originally Posted by NumbSkull
Посмотреть сообщение
what is COL_WHITE defined as? is it a color definition? only strings can be stuffed in like that like if
pawn Код:
#define COL_WHITE "poooooop"
#define COL_WHITE 0xFFFFFFFF

And the other code still game me the same errors :S


Re: Expected token - Register Dialog - NumbSkull - 30.11.2012

COL_WHITE can only be used in asigning a color to a thing like
pawn Код:
SendClientMessage(playerid, COL_WHITE, "Welcome to my server!");
not stuffed into a place that is looking for a string in there use the websafe hex colors like GiamPy said


Re: Expected token - Register Dialog - Lz - 30.11.2012

Quote:
Originally Posted by NumbSkull
Посмотреть сообщение
COL_WHITE can only be used in asigning a color to a thing like
pawn Код:
SendClientMessage(playerid, COL_WHITE, "Welcome to my server!");
not stuffed into a place that is looking for a string in there use the websafe hex colors like GiamPy said
Thanks, Does this mean i have to change my color defines?


Re: Expected token - Register Dialog - NumbSkull - 30.11.2012

no it just means you cant use them inside a string like that


Re: Expected token - Register Dialog - mamorunl - 30.11.2012

Those HEX values can only be used in functions as SendClientMessage (the second parameter). A full string has to be entered in functions as ShowPlayerDialog. The format is different.

Second parameter in (eg) SendClientMessage is a real HEX value. ShowPlayerDialog stuff is a string formatted between brackets.


Re: Expected token - Register Dialog - yhanyhanAKOyhan - 01.12.2012

I think you didn't call the dialog ID NUMBER to call..hehehe am i right?


Re: Expected token - Register Dialog - JaKe Elite - 01.12.2012

What is in your line 91??