SA-MP Forums Archive
Login/register errors - 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: Login/register errors (/showthread.php?tid=422451)



Login/register errors - Dwerig - 13.03.2013

Код:
C:\Users\BLABLABLA\gamemodes\name.pwn(105) : error 017: undefined symbol "pLogged"
C:\Users\BLABLABLA\gamemodes\name.pwn(105) : warning 215: expression has no effect
C:\Users\BLABLABLA\gamemodes\name.pwn(105) : error 001: expected token: ";", but found "]"
C:\Users\BLABLABLA\gamemodes\name.pwn(105) : error 029: invalid expression, assumed zero
C:\Users\BLABLABLA\gamemodes\name.pwn(105) : fatal error 107: too many error messages on one line
Followed this tutorial; https://sampforum.blast.hk/showthread.php?tid=269361 and got these errors between step 2 and three. What's wrong? I added step two things on the top of the script. What's wrong?

At line 103-105 is it:
Код:
public OnPlayerConnect(playerid)
{
    pLogged[playerid] = 0;



Re: Login/register errors - Mystique - 13.03.2013

Show me your line on top of the script, because that piece of code there is completely correct.


Re: Login/register errors - Calabresi - 13.03.2013

Do you have;

pawn Код:
new pLogged[MAX_PLAYERS];
On top of the script?


Re: Login/register errors - Dwerig - 13.03.2013

Quote:

enum iDetails { //Enumerating player data
Pass,
Cash,
Score,
Banned
};
new pInfo[MAX_PLAYERS][iDetails]; //Player data variable

new pIP[MAX_PLAYERS][16]; //For autologin

new pLogged[MAX_PLAYERS];

stock PlayerPath(playerid) { //This will give us faster access to a player's path
new iStr[256],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(iStr,sizeof(iStr),PATH,name);
return iStr;
}
//ret_memcpy
#pragma unused ret_memcpy

This as the tutorial says.


Re: Login/register errors - Calabresi - 13.03.2013

Probably you have a brace open or something like that, inspect every line.


Re: Login/register errors - Mystique - 13.03.2013

Allright.. Show me the OnPlayerConnect callback to see if there's anything wrong there because it should work.


Re: Login/register errors - Dwerig - 13.03.2013

Quote:

public OnPlayerConnect(playerid)
{
pLogged[playerid] = 0;
#if defined AUTOLOGIN
new tmpIP[16];
GetPlayerIp(playerid,tmpIP,sizeof(tmpIP)); //Getting IP
#endif
if(fexist(PlayerPath(playerid))) {
INI_ParseFile(PlayerPath(playerid), "UserDataLoad_%s", .bExtra = true, .extra = playerid); //Calling loading callback
#if defined AUTOLOGIN
if(strcmp(tmpIP,pIP[playerid],true) == 0) { //Checking if the IPs match
pLogged[playerid] = 1;
SetPlayerScore(playerid,pInfo[playerid][Score]);
GivePlayerMoney(playerid,pInfo[playerid][Cash]);
SendClientMessage(playerid,lime,"You've been auto-logged in. [IP match]");
return 1;
}
#endif
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYL E_INPUT,"Login","Please enter your password below.","Login","Leave");
} else {
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_S TYLE_INPUT,"Register","Please register by entering a password below.","Register","Leave");
}
return 1;
}

forward UserDataLoad_data(playerid,name[],value[]);

public UserDataLoad_data(playerid,name[],value[]) { //This loads the settings from the INI file
INI_Int("Pass",pInfo[playerid][Pass]);
INI_String("IP",pIP[playerid],16);
INI_Int("Admin",pInfo[playerid][Admin]);
INI_Int("Cash",pInfo[playerid][Cash]);
INI_Int("Score",pInfo[playerid][Score]);
INI_Int("Banned",pInfo[playerid][Banned]);
return 1;
}

There you go


Re: Login/register errors - Mystique - 13.03.2013

Can't find a problem, check for the rest of the script that there is no bracket gone. Weird thing is the
Код:
 pLogged[playerid] = 1;
has no errors.


Re: Login/register errors - Dwerig - 13.03.2013

Damn..