A little help here?
#1

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.
Reply
#2

Did you make sure that UserPath exists?
Reply
#3

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

add ;

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

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

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.
Reply
#6

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;

Reply
#7

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
Reply
#8

Thank you very much.
It's work for me.
Reply
#9

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)