y_ini on player disconnect error - 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: y_ini on player disconnect error (
/showthread.php?tid=613979)
y_ini on player disconnect error -
Dejan12345 - 03.08.2016
Код:
;
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
Re: y_ini on player disconnect error -
AndySedeyn - 03.08.2016
Can you show me the code above? I see a trailing semicolon (';') right above OnPlayerDisconnect.
Re: y_ini on player disconnect error -
Dejan12345 - 03.08.2016
Код:
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;
Re: y_ini on player disconnect error -
AndySedeyn - 03.08.2016
'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(playerid, reason)
{
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.
Re: y_ini on player disconnect error -
Dejan12345 - 03.08.2016
dont have this code
Re: y_ini on player disconnect error -
AndySedeyn - 03.08.2016
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?
Re: y_ini on player disconnect error -
Dejan12345 - 03.08.2016
i fix