public OnPlayerDisconnect(playerid, reason)
{
new pName2[24];
new str[128];
GetPlayerName(playerid, pName2, 24);
KillTimer(UserTimer[playerid]);
switch(reason)
{
case 0: format(str, 128, "%s (%d) Has Left The Server. (Timeout/Crashed)", pName2,playerid);
case 1: format(str, 128, "%s (%d) Has Left The Server. (Leaving)", pName2,playerid);
case 2:
{
format(str, 128, "%s (%d) Has Left The Server. (Kicked/Banned)", pName2,playerid);
Info[playerid][TimesKicked] +=1;
}
}
SendClientMessageToAll(0xAFAFAFAA, str);
if(fexist(Path(playerid)))
{
UserSaver(playerid);
} // 6708 Line
public UserSaver(playerid)
{
if(fexist(Path(playerid)))
{
if(Info[playerid][Logged] == 1)
{
new INI:File = INI_Open(Path(playerid));
INI_SetTag(File,"data");
INI_WriteString(File,"Password",PlayerInfo[playerid][pPass]);
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Management",PlayerInfo[playerid][pMT]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
INI_WriteInt(File,"Drugs",LPinfo[playerid][Drugs]);
INI_WriteInt(File,"Adrenaline",LPinfo[playerid][Adre]);
INI_WriteInt(File,"VIPLevel",Info[playerid][VIPLevel]);
INI_WriteInt(File,"FavouriteSkin",Info[playerid][Favouriteskin]);
INI_WriteInt(File,"FavouriteSong",Favouritesong[playerid]);
INI_WriteInt(File,"BankMoney",BankMoney[playerid]);
INI_WriteInt(File,"Daysalive",Daysalive[playerid]);
INI_WriteInt(File,"Banned",Info[playerid][Banned]);
INI_WriteInt(File,"Muted",Info[playerid][Muted]);
INI_WriteInt(File,"MuteWarnings",Info[playerid][MuteWarnings]);
INI_WriteInt(File,"MaxMuteWarnings",Info[playerid][MaxMuteWarnings]);
INI_WriteInt(File,"Warnings",Info[playerid][Warnings]);
INI_WriteInt(File,"TimesKicked",Info[playerid][TimesKicked]);
INI_WriteInt(File,"StartingMusic",Info[playerid][StartingMusic]);
INI_WriteInt(File,"Respect",Info[playerid][Respect]);
INI_WriteInt(File,"AutoUseSkin",Autouseskin[playerid]);
INI_WriteInt(File,"FightingSkill",fskillid[playerid]);
INI_WriteInt(File,"TurfsCaptured",Turfscaptured[playerid]);
INI_WriteInt(File,"TurfsLost",Turfslost[playerid]);
INI_WriteInt(File,"AssistedTurfsCaptured",ATC[playerid]);
INI_WriteInt(File,"Hours",PlayerInfo[playerid][pHours]);
INI_WriteInt(File,"Minutes",PlayerInfo[playerid][pMins]);
INI_WriteInt(File,"ObjectEditor",PlayerInfo[playerid][OEditor]);
INI_WriteInt(File,"KillSounds",Info[playerid][KillSounds]);
INI_Close(File);
if(IsPlayerConnected(playerid))SendClientMessage(playerid, 0x00FFFFFF, "Your Stats Has Been {FFF700}Automatically{00FFFF} Saved.");
}
}
return 1;
}
public OnPlayerEditAttachedObject( playerid, response, index, modelid, boneid,Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ,Float:fRotX, Float:fRotY, Float:fRotZ,Float:fScaleX, Float:fScaleY, Float:fScaleZ)
{
/*new debug_string[256+1];
format(debug_string,256,"SetPlayerAttachedObject(playerid,%d,%d,%d,%f,%f,%f,%f,%f,%f,%f,%f,%f)",
index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);*/
SetPlayerAttachedObject(playerid,index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);
SendClientMessage(playerid, 0xFFFFFFFF, "You have finished editing attachments, it has been saved to your database.");
new file[124];
new name[24];
new f1[15];
GetPlayerName(playerid,name,24);
format(file,sizeof(file),"PlayerObjects/%s.ini",name);
new INI:data = INI_Open(file);
INI_SetTag(data,"Attachments");
format(f1,15,"O_Model_%d",index);
INI_WriteInt(data,f1,modelid);
format(f1,15,"O_Bone_%d",index);
INI_WriteInt(data,f1,boneid);
format(f1,15,"O_OffX_%d",index);
INI_WriteFloat(data,f1,fOffsetX);
format(f1,15,"O_OffY_%d",index);
INI_WriteFloat(data,f1,fOffsetY);
format(f1,15,"O_OffZ_%d",index);
INI_WriteFloat(data,f1,fOffsetZ);
format(f1,15,"O_RotX_%d",index);
INI_WriteFloat(data,f1,fRotX);
format(f1,15,"O_RotY_%d",index);
INI_WriteFloat(data,f1,fRotY);
format(f1,15,"O_RotZ_%d",index);
INI_WriteFloat(data,f1,fRotZ);
format(f1,15,"O_ScaleX_%d",index);
INI_WriteFloat(data,f1,fScaleX);
format(f1,15,"O_ScaleY_%d",index);
INI_WriteFloat(data,f1,fScaleY);
format(f1,15,"O_ScaleZ_%d",index);
INI_WriteFloat(data,f1,fScaleZ);
INI_Close(data);
return 1; // Line 13474
}
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
PlayerAlreadyLoggedIn[playerid] = 1;
PlayerAlreadyRegisteredIn[playerid] = 1;
F_GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
SetPlayerScore(playerid, LPinfo[playerid][Score]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Welcome To The Server!\nYou have successfully logged in!\n\n"COL_WHITE"Please Make Sure That You Have Read All Our "COL_RED"/rules"COL_WHITE".","Ok","");
UserTimer[playerid] = SetTimerEx("UserSaver", 100000, true, "d", playerid);
PlayerDays[playerid] = SetTimerEx("DaysAlive", 1380000, true, "d", playerid);
Minscount[playerid] = SetTimerEx("Minscounter", 60000, true, "d", playerid);
GetPlayerName(playerid, logplayer, MAX_PLAYER_NAME);
format(pmsg, sizeof(pmsg), "[LOGIN] %s (%d) Has Logged In To His Account.", logplayer, playerid);
SendClientMessageToAll(0x00B8C2AA, pmsg);
new INI:File = INI_Open(UserPath2(playerid));
INI_WriteString(File,"IP", ip);
INI_Close(File); // Line 11404
|
I won't help you just because you think that we (I at least) need something like +REP to help you.
|
|
[22:05:55] [debug] Run time error 4: "Array index out of bounds" [22:05:55] [debug] Accessing element at negative index -1 [22:05:55] [debug] AMX backtrace: [22:05:55] [debug] #0 000185e4 in INI_Close (INI:file=-1) at D:\SA-MP Things\SAMP 0.3.7 R2\pawno\include\YSI\y_ini.inc:746 [22:05:55] [debug] #1 00024874 in public UserSaver (playerid=0) at D:\SA-MP Things\SAMP 0.3.7 R2\gamemodes\LSGW.pwn:2143 [22:05:55] [debug] #2 00071fec in public OnPlPa_OnPlayerDisconnect (playerid=0, reason=1) at D:\SA-MP Things\SAMP 0.3.7 R2\gamemodes\LSGW.pwn:6708 [22:05:55] [debug] #3 native CallLocalFunction () from samp03svr [22:05:55] [debug] #4 0001fa7c in ?? (... <2 arguments>) at D:\SA-MP Things\SAMP 0.3.7 R2\pawno\include\whenpause.inc:125 [22:05:55] [debug] #5 0000de3c in public SSCANF_OnPlayerDisconnect (playerid=0, reason=1) at D:\SA-MP Things\SAMP 0.3.7 R2\pawno\include\YSI\y_hooks/impl.inc:661 [22:05:55] [debug] #6 000010ac in public Itter_OnPlayerDisconnect (playerid=0, reason=1) at D:\SA-MP Things\SAMP 0.3.7 R2\pawno\include\sscanf2.inc:229 [22:05:55] [debug] #7 native CallLocalFunction () from samp03svr [22:05:55] [debug] #8 000008f0 in public OnPlayerDisconnect (playerid=0, reason=1) at D:\SA-MP Things\SAMP 0.3.7 R2\pawno\include\foreach.inc:643 |
|
This function starts the write process, it doesn't actually open a file, just sets up the buffer. On success it returns a handle to the ini with tag INI, on fail it returns INI_NO_FILE (INI:-1): |
|
EDIT: the weird thing is that this problem doesn't occur in Windows only Linux.
|