y_ini on player disconnect error
#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;
}
Код:
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(289) : error 017: undefined symbol "UserPath"
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(291) : error 017: undefined symbol "PlayerInfo"
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(291) : warning 215: expression has no effect
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(291) : error 001: expected token: ";", but found "]"
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(291) : error 029: invalid expression, assumed zero
C:\Users\PC\Desktop\Dejanovi folderi\Black Angeles Roleplay\gamemodes\BARP.pwn(291) : fatal error 107: too many error messages on one line

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


5 Errors.
help
Reply
#2

Can you show me the code above? I see a trailing semicolon (';') right above OnPlayerDisconnect.
Reply
#3

Код:
public OnPlayerDisconnect(playerid, reason)
{
	new INI:File = INI_Open(UserPath(playerid));
	INI_SetTag(File,"data");
	INI_WriteInt(File,"Spol",PlayerInfo[playerid][Pol]);
	INI_WriteInt(File,"Porijeklo",PlayerInfo[playerid][pDeaths]);
	INI_Close(File);
 }
	return 1;
Reply
#4

'return 1' belongs inside the function block of OnPlayerDisconnect; between the curly brackets.

This is what you had in your original post:
PHP код:
;
public 
OnPlayerDisconnect(playeridreason)

I don't think that semicolon (';') should be there. But I can't tell, if you're not willing to show me the code right above it.
Reply
#5

dont have this code
Reply
#6

It's definitely a trailing semicolon, a misplaced semicolon, a misplaced bracket or a forgotten bracket. Unless you don't have the function 'UserPath' and variable 'PlayerInfo' defined as the error says.

Can you confirm that both the function and the variable are declared? If yes, can you show me exactly the error lines and preferably also code above and under them?
Reply
#7

i fix
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)