Problem at YNI. - Please, help.
#1

After i finished trying to make a register/login system, pressed F5 and boom... 6 errors:
C:\Users\K-9\Desktop\Server Kenzo -BY ME\gamemodes\KenzoGM.pwn(3 : error 001: expected token: "-identifier-", but found "-integer value-"
C:\Users\K-9\Desktop\Server Kenzo -BY ME\gamemodes\KenzoGM.pwn(42) : error 020: invalid symbol name ""
C:\Users\K-9\Desktop\Server Kenzo -BY ME\gamemodes\KenzoGM.pwn(47) : error 017: undefined symbol "INI_Int"
C:\Users\K-9\Desktop\Server Kenzo -BY ME\gamemodes\KenzoGM.pwn(47) : warning 215: expression has no effect
C:\Users\K-9\Desktop\Server Kenzo -BY ME\gamemodes\KenzoGM.pwn(47) : error 001: expected token: ";", but found "]"
C:\Users\K-9\Desktop\Server Kenzo -BY ME\gamemodes\KenzoGM.pwn(47) : error 029: invalid expression, assumed zero
C:\Users\K-9\Desktop\Server Kenzo -BY ME\gamemodes\KenzoGM.pwn(47) : fatal error 107: too many error messages on one line

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


6 Errors.









Those are the lines including the register/login system. Please respond fast. Thanks.\

Код:
enum pInfo
{
      pPass,
      pCash,
38.  pAdmin,
      pKills,
      pDeaths
}
42.  new PlayerInfo[MAX_PLAYERS][pInfo];

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
47  INI_Int("Password",PlayerInfo[playerid][pPass];
	INI_Int("Cash",PlayerInfo[playerid][pCash]);
	INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
	INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
 	return 1;
 	
}

stock UserPath(playerid)
{
	new string[128],playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid,playername,sizeof(playername));
	format(string,sizeof(string),PATH,playername);
	return string;
}

stock udb_hash(buf[]) {
	new length=strlen(buf);
    new s1 = 1;
    new s2 = 0;
    new n;
    for (n=0; n<length; n++)
    {
       s1 = (s1 + buf[n]) % 65521;
       s2 = (s2 + s1)     % 65521;
    }
    return (s2 << 16) + s1;
}

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;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_Close(File);

                SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
			}
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
					ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
	new INI:File = INI_Open(UserPath(playerid));
	INI_SetTag(File,"data");
	INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
	INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
	INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
	INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
	INI_Close(File);
	return 1;
}


public OnPlayerDeath(playerid, killerid, reason)
{
	PlayerInfo[killerid][pKills]++;
	PlayerInfo[playerid][pDeaths]++;
	return 1;
}
Reply
#2

use the tags to order your code and please indicate which line is which.
Reply
#3

Done.

38 - error 001

42 - error 020

47 - the rest of them.
Reply
#4

For the error of the line 38, you maybe have the following in your gamemode:

PHP код:
new pAdmin;
// or
#define pAdmin 
It'd be really bad to erase these values as they may be working in conjunct with another function. The better solution is to change it name at the enum:

PHP код:
enum pInfo
{
      
pPass,
      
pCash,
38.  psAdmin// we changed it for psAdmin
      
pKills,
      
pDeaths

The error of the line 42 should be fixed along with the above.

Remember to rename all of these values to match with the edited one, as an example:

Код:
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
change for
Код:
INI_Int("Admin",PlayerInfo[playerid][psAdmin]);
As for the line 47, you forgot to close the bracket
PHP код:
47  INI_Int("Password",PlayerInfo[playerid][pPass]; // you must add a closing bracket ')' before the semi colon ';' 
EDIT: Also, I did not notice, but you're posting in the wrong section, the following link is the place you should go for problems like this one.
http://forum.sa-mp.com/forumdisplay.php?f=12
Reply
#5

Ok, so 2 of them are fixed, i changed and put that "s" and they are fixed now.

But at 47 seems that it doesn't want to work at all.
Changed the names, close the bracked and still the same thing: C:\Users\K-9\Desktop\Server Kenzo -BY ME\gamemodes\KenzoGM.pwn(47) : error 029: invalid expression, assumed zero
C:\Users\K-9\Desktop\Server Kenzo -BY ME\gamemodes\KenzoGM.pwn(47) : warning 215: expression has no effect
C:\Users\K-9\Desktop\Server Kenzo -BY ME\gamemodes\KenzoGM.pwn(47) : error 001: expected token: ";", but found "]"
C:\Users\K-9\Desktop\Server Kenzo -BY ME\gamemodes\KenzoGM.pwn(47) : error 029: invalid expression, assumed zero
C:\Users\K-9\Desktop\Server Kenzo -BY ME\gamemodes\KenzoGM.pwn(47) : fatal error 107: too many error messages on one line
Reply
#6

Please, help?
Reply
#7

Post in the other section, also it seems that you did not fix what i told you to fix in the line 47.

Show to me what did you change of it.
Reply
#8

Posted, thanks for information.

And i closed the bracket after that line that you tolded me, that's what i changed to it as you said.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)