[02:36:36] [debug] Run time error 4: "Array index out of bounds"
[02:36:36] [debug] Accessing element at negative index -1
[02:36:36] [debug] AMX backtrace:
[02:36:36] [debug] #0 00016c00 in INI_Close (INI:file=-1) at C:\Users\Administrator\Desktop\Stunt Field League - Build 1\pawno\include\YSI\y_ini.inc:746
[02:36:36] [debug] #1 0001b4c4 in public S@@_OnPlayerDisconnect (playerid=0, reason=1) at C:\Users\Administrator\Desktop\Stunt Field League - Build 1\gamemodes\SFL.pwn:140
[02:36:36] [debug] #2 0000dbf4 in public Streamer_OnPlayerDisconnect (playerid=0, reason=1) at C:\Users\Administrator\Desktop\Stunt Field League - Build 1\pawno\include\YSI\y_hooks/impl.inc:661
[02:36:36] [debug] #3 native CallLocalFunction () [00471e90] from samp-server.exe
[02:36:36] [debug] #4 00007a98 in Debug_Print0 (... <2 variable arguments>) at C:\Users\Administrator\Desktop\Stunt Field League - Build 1\pawno\include\streamer.inc:361
[02:36:36] [debug] #5 00000354 in Debug_Print0 (... <2 variable arguments>) at C:\Users\Administrator\Desktop\Stunt Field League - Build 1\pawno\include\sscanf2.inc:229
INI_Close(File);
OnPlayerDisconnect ( playerid , reason )
{
new string [ 128 ] ;
switch ( reason )
{
case 0: format(string, 128, "{FFFF00}%s {008000}a iesit de pe server {FFFFFF}(Timeout)", P_NAME( playerid )) ;
case 1: format(string, 128, "{FFFF00}%s {008000}a iesit de pe server {FFFFFF}(Leaving)", P_NAME( playerid ));
case 2: format(string, 128, "{FFFF00}%s {008000}a iesit de pe server {FFFFFF}(Kicked/Banned)", P_NAME( playerid ));
}
SCMTA ( COLOR_WHITE , string );
if(playerid != INVALID_PLAYER_ID)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",P_INFO[playerid][Level]);
INI_WriteInt(File,"V.I.P",P_INFO[playerid][Vip]);
INI_WriteInt(File,"Kills",P_INFO[playerid][Kills]);
INI_WriteInt(File,"Deaths",P_INFO[playerid][Deaths]);
INI_Close(File); //here
}
return ( 1 );
}
sounds like INI_Open failed to open because file doesn't exist.
can you show me the stock of UserPath() ? |
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),PATH,playername);
return string;
}
Sure :
pawn Код:
|
show me the #define of PATH & are you sure that the file exists?
|
#define PATH "/SFL/users/%s.ini"
printf("UserPath: %s", UserPath(playerid));