Ysi register error
#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,"Registrac                        ija","Lozinka uspesna!","Registracija","Izadji");
				new INI:File = INI_Open(UserPath(playerid));
				INI_SetTag(File,"data");
				INI_WriteInt(File,"Password",udb_hash(inputtext));
				INI_WriteInt(File,"Cash",0);
				INI_Close(File);
				return 1;
			}
		}
		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]);
			        SendClientMessage(playerid, -1, "Uspesno si se logovao!");
			    }
		            else
		            {
	                    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Logovanje:","Lozinka nije tacna probaj                            opet!","Login","Izadji");
		            }

                        }
                }
   }
   return 1;
}
Код:
public OnPlayerConnect(playerid)
{
	if(fexist(UserPath(playerid))
	{
		INI_ParseFile(UserPath(playerid),"LoadUser_%s",.bExtra = true,.extra = playerid);
		ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login:","Upisite vasu lozinku","Login","Izadji");
	else
	{
		ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registracija:","Upisite vasu lozinku","Registracija");                ","Izadji");
	}
	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_Close(File);

return 1;
}
Код:
public LoadUser_data(playerid,name[].value[])
{
	INI_Int("Password",PlayerInfo[playerid][pPass]); // Sacuva lozinku
	INI_Int("Cash",PlayerInfo[playerid][pCash]); // Sazuva pare
	{
	return 1;
}

stock UserPath(playerid)
{
	new string[128],playername[MAX_PLAYER_NAME]; // Definise ili pravi ime igraca(koristi ime igraca)
	GetPlayerName(playerid,playername,sizeof(playername)); // Ovaj kod uzima to jest dobija ime igraca
	format(string,sizeof(string),PATH,playername); // Format za ime!
	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;
}
errors
Код:
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(231) : error 017: undefined symbol "UserPath"
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(233) : error 017: undefined symbol "UserPath"
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(235) : error 029: invalid expression, assumed zero
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(237) : warning 202: number of arguments does not match definition
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(237) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(237) : warning 215: expression has no effect
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(237) : error 001: expected token: ";", but found "-identifier-"
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(237) : error 017: undefined symbol "Izadji"
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(237) : fatal error 107: too many error messages on one line
help guys
Reply
#2

help
Reply
#3

Код:
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registracija:","Upisite vasu lozinku","Registracija");                ","Izadji");
change the account localization
Код:
stock UserPath(playerid)
{
	new gName[24], String[80];
	GetPlayerName(playerid, gName, 24);
	format(String, 80, "Accounts/%s.ini", gName);
	return String;
}
Reply
#4

Please read this -> https://sampwiki.blast.hk/wiki/Errors_List
It will make you understand errors and their meanings a bit better so you don't have to make a thread every time you get an error.Just look it up here and check the solution or search for similar threads regarding that error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)