Help me with this error.
#1

So, I have an error:

ERROR:
Код:
#:\#\#\gamemode.pwn(119) : error 001: expected token: "-string end-", but found "-identifier-"
#:\#\#\gamemode.pwn(119) : warning 215: expression has no effect
#:\#\#\gamemode.pwn(119) : error 001: expected token: ";", but found ")"
#:\#\#\gamemode.pwn(119) : error 029: invalid expression, assumed zero
#:\#\#\gamemode.pwn(119) : fatal error 107: too many error messages on one line
SCRIPT
Код:
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 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;
}
THE LINE:
Код:
if(fexist(UserPath(playerid)))
Can anyone tell me how to solve this and why is a error?
Reply
#2

You using a downloaded login system?.
Reply
#3

I use all codes from this tutorial:

https://sampforum.blast.hk/showthread.php?tid=273088
Reply
#4

Post the UserPath function and how you defined PATH. You missed something from that tutorial.
Reply
#5

There is UserPath Function:
Код:
#define UserPath "/Users/%s.ini"
How I defined it? I don't know what you want to say sorry, maybe this? :

Код:
stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}
Reply
#6

Change to:
pawn Код:
#define PATH "/Users/%s.ini"
and keep UserPath as:
pawn Код:
stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}
Reply
#7

Now i have this:

Код:
#:\#\#\gamemode.pwn(119) : error 001: expected token: "-string end-", but found "-identifier-"
#:\#\#\gamemode.pwn(119) : warning 215: expression has no effect
#:\#\#\gamemode.pwn(119) : error 001: expected token: ";", but found ")"
#:\#\#\gamemode.pwn(119) : error 029: invalid expression, assumed zero
#:\#\#\gamemode.pwn(119) : fatal error 107: too many error messages on one line
Script:
Код:
public OnPlayerConnect(playerid)
{
    if(fexist(PATH(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_LIGHTRED"Login",""COL_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");
    }

//_______________MAPPING_______________//
//_______________BIKE RENT_______________//
CreateObject(970, 50.47583, 1178.51917, 18.19350,   0.00000, 0.00000, 90.00000);
CreateObject(970, 50.47580, 1174.26050, 18.19350,   0.00000, 0.00000, 90.00000);
CreateObject(970, 50.47580, 1170.00623, 18.19350,   0.00000, 0.00000, 90.00000);
CreateObject(970, 48.36243, 1180.46606, 18.21580,   0.00000, 0.00000, 2.82000);
CreateObject(970, 44.04394, 1180.26526, 18.21870,   0.00000, 0.00000, 3.36000);
CreateObject(970, 41.89978, 1177.93054, 18.23760,   0.00000, 0.00000, 88.14000);
CreateObject(970, 41.73800, 1173.62903, 18.23700,   0.00000, 0.00000, 87.36000);
CreateObject(970, 41.51110, 1169.38062, 18.21830,   0.00000, 0.00000, 87.06000);
//_______________BIKE RENT_______________//
//_______________MAPPING_______________//
return 1;
}
**Don't give a fuc* about the mapping is just some map testing**

The line is :
Код:
if(fexist(PATH(playerid)))
I don't know what I am doing wrong , if I give you the GM.pwn can you fix and after you can explain me?
Reply
#8

No, you didn't understand me.

PATH should be:
pawn Код:
#define PATH "/Users/%s.ini"
UserPath should be:
pawn Код:
stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}
so you can check like that:
pawn Код:
if(fexist(UserPath(playerid)))
Reply
#9

Ok, all you said I made, but now:

ERROR:
Код:
#:\#\#\gamemode.pwn(118) : error 017: undefined symbol "UserPath"
#:\#\#\gamemode.pwn(120) : error 017: undefined symbol "UserPath"
#:\#\#\gamemode.pwn(121) : error 001: expected token: "-string end-", but found "-identifier-"
#:\#\#\gamemode.pwn(121) : warning 215: expression has no effect
#:\#\#\gamemode.pwn(121) : error 001: expected token: ";", but found "-string-"
#:\#\#\gamemode.pwn(121) : warning 215: expression has no effect
#:\#\#\gamemode.pwn(121) : error 001: expected token: "-string end-", but found "-identifier-"
#:\#\#\gamemode.pwn(121) : fatal error 107: too many error messages on one line
The Script :

Код:
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_GREY"Login",""COLOR_GREY"Type your password below to login.","Login","Quit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COLOR_GREY"Registering...",""COLOR_GREY"Type your password below to register a new account.","Register","Quit");
    }
    return 1;
}
And the lines are :

118:
Код:
if(fexist(UserPath(playerid)))
120:
Код:
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
121:
Код:
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_GREY"Login",""COLOR_GREY"Type your password below to login.","Login","Quit");
Reply
#10

You're still doing it wrong. How is UserPath an undefined symbol if you've done what I said and having the stock in your gamemode?

Post again, how UserPath and PATH are defined.

EDIT: Or just follow the tutorial again. The tutorial is fine, you just did a mistake on the name even though, in the tutorial is correct.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)