SA-MP Forums Archive
A little help here? - 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: A little help here? (/showthread.php?tid=619131)



A little help here? - ChandraLouis - 14.10.2016

This is the errors that i've got:
Quote:

TDM.pwn(490) : error 001: expected token: "-string end-", but found "-identifier-"
TDM.pwn(490) : warning 215: expression has no effect
TDM.pwn(490) : error 001: expected token: ";", but found ")"
TDM.pwn(490) : error 029: invalid expression, assumed zero
TDM.pwn(490) : fatal error 107: too many error messages on one line

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


4 Errors.

This is the script:
pawn Код:
pInfo[playerid][AdminLevel] = 0;
pInfo[playerid][LoggedIn] = false;
if(fexist(UserPath(playerid)))
{
    INI_ParseFile(UserPath(playerid), "LoadPlayerData", .bExtra = true, .extra = playerid)
    format(string, sizeof(string),""COL_LIGHTBLUE"Welcome back to LSGW, "COL_BLUE"%s!\n\n"COL_LIGHTBLUE"To be able to spawn, play, and takes the advantage of the features that we offer, you need to login to this account.\n\n"COL_RED"Insert your password in the field below.\nIf this is not your account, please make one!", GetPlayersName(playerid));
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Account Login", string, "Login", "Quit");
}
else
{
    format(string, sizeof(string),""COL_LIGHTBLUE"Welcome to LSGW, "COL_BLUE"%s!\n\n"COL_LIGHTBLUE"To be able to spawn, play, and takes the advantage of the features that we offer, you need to register an account.\n\n"COL_RED"Insert your password in the field below.\nDon't ever give it to other people, even our administrators!",GetPlayersName(playerid));
    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Account Register", string, "Register", "Quit");
}
Line 490:
pawn Код:
if(fexist(UserPath(playerid)))

Help me please.


Re: A little help here? - JaKe Elite - 14.10.2016

Did you make sure that UserPath exists?


Re: A little help here? - TheDrx - 14.10.2016

INI_ParseFile(UserPath(playerid), "LoadPlayerData", .bExtra = true, .extra = playerid)

add ;

INI_ParseFile(UserPath(playerid), "LoadPlayerData", .bExtra = true, .extra = playerid);


Re: A little help here? - ChandraLouis - 14.10.2016

Jake Elite@ UserPath did exist in my script.
pawn Код:
#define UserPath "/Users/%s.ini"
TheDrx@ It's not working too.


Re: A little help here? - TheDrx - 14.10.2016

Quote:
Originally Posted by ChandraLouis
Посмотреть сообщение
Jake Elite@ UserPath did exist in my script.
pawn Код:
#define UserPath "/Users/%s.ini"
TheDrx@ It's not working too.
Well that's the error. Give me the console result after editing like said, please.


Re: A little help here? - Mencent - 14.10.2016

Hello.

Take this:
PHP код:
//Your code:
pInfo[playerid][AdminLevel] = 0;
pInfo[playerid][LoggedIn] = false;
if(
fexist(UserPath(playerid)))
{
    
INI_ParseFile(UserPath(playerid), "LoadPlayerData", .bExtra true, .extra playerid);
    
format(stringsizeof(string),""COL_LIGHTBLUE"Welcome back to LSGW, "COL_BLUE"%s!\n\n"COL_LIGHTBLUE"To be able to spawn, play, and takes the advantage of the features that we offer, you need to login to this account.\n\n"COL_RED"Insert your password in the field below.\nIf this is not your account, please make one!"GetPlayersName(playerid));
    
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD"Account Login"string"Login""Quit");
}
else
{
    
format(stringsizeof(string),""COL_LIGHTBLUE"Welcome to LSGW, "COL_BLUE"%s!\n\n"COL_LIGHTBLUE"To be able to spawn, play, and takes the advantage of the features that we offer, you need to register an account.\n\n"COL_RED"Insert your password in the field below.\nDon't ever give it to other people, even our administrators!",GetPlayersName(playerid));
    
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT"Account Register"string"Register""Quit");
}
//your define:
#define PATH "/Users/%s.ini"
//the stock to use UserPath:
stock UserPath(playerid)
{
    new 
string[35],playername[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,playername,sizeof(playernam e));
    
format(string,sizeof(string),PATH,playername);
    return 
string;




Re: A little help here? - JaKe Elite - 14.10.2016

EDIT: Mencent answered first, damn you are fast boi..

That explains it, Where do you use the defined UserPath in which function? There should be a function something like this if I remember..

PHP код:
stock PlayerPath(playerid)
{
    new 
pName[24], string[128];
    
GetPlayerName(playeridpName24);
    
format(stringsizeof(string), UserPathpName);
    return 
string;

If you do not have the function, Copy the code above and place it below your script then you can use this on stuffs like;

PHP код:
if(fexist(PlayerPath(playerid))) 
Change your UserPath(playerid) to PlayerPath(playerid) too if you are gonna use my function


Re: A little help here? - ChandraLouis - 14.10.2016

Thank you very much.
It's work for me.


Re: A little help here? - Gotham - 14.10.2016

Use colour Defines without the 0x make it
PHP код:
#define COL_BLUE "{HEXCODEWITHOUT0x}" 
I got a similar error Like this So I dunno if I am correct.
Edit: :P I didn't notice that