Help With That!
#1

[09:52:20] [connection] 172.16.32.155:55484 requests connection cookie.
[09:52:21] [connection] incoming connection: 172.16.32.155:55484 id: 0
[09:52:21] [join] JuzDoiT has joined the server (0:172.16.32.155)
[09:52:32] [debug] Run time error 4: "Array index out of bounds"
[09:52:32] [debug] Accessing element at negative index -1
[09:52:32] [debug] AMX backtrace:
[09:52:32] [debug] #0 000a68a0 in ?? (-1) from DEATHMATCH.amx
[09:52:32] [debug] #1 000a67d8 in ?? (-1, -1) from DEATHMATCH.amx
[09:52:32] [debug] #2 000a6588 in ?? (0, 2) from DEATHMATCH.amx
[09:52:32] [debug] #3 00038674 in public Itter_OnPlayerDisconnect (0, 2) from DEATHMATCH.amx
[09:52:32] [debug] #4 000195a8 in ?? (0, 2) from DEATHMATCH.amx
[09:52:32] [debug] #5 0000d344 in public SSCANF_OnPlayerDisconnect (0, 2) from DEATHMATCH.amx
[09:52:32] [debug] #6 000007cc in public OnPlayerDisconnect (0, 2) from DEATHMATCH.amx
[09:52:32] [debug] #7 native Kick () from samp-server.exe
[09:52:32] [debug] #8 000b1114 in ?? (0, 2, 0, -1, 68464872) from DEATHMATCH.amx
[09:52:32] [debug] #9 000104f8 in public OnDialogResponse (0, 2, 0, -1, 68464872) from DEATHMATCH.amx
[09:52:32] [part] JuzDoiT has left the server (0:2)


public OnPlayerDisconnect(playerid, reason)
{
new string[256];
SetPlayerColor(playerid, COLOR_DEAD);

LastAttack[playerid] = INVALID_PLAYER_ID;

ResetPlayerWeapons(playerid);
DeleteNeon(playerid);

if(InDuel[playerid] == 1)
{
new msg[128];
format(msg, sizeof(msg), "Duel Between %s (%d) and %s (%d) Has Ended. Reason: {ff0000}Disconnected!", PlayerInfo[DuelPlayer1][pName], DuelPlayer1, PlayerInfo[DuelPlayer2][pName], DuelPlayer2);
SendClientMessageToAll(COLOR_SERVER_HELP_MSG, msg);

Progress = 0;
InDuel[DuelPlayer1] = 0;
InDuel[DuelPlayer2] = 0;

KillTimer(DUEL_TIMER);

SpawnPlayer(DuelPlayer1);
SetPlayerVirtualWorld(DuelPlayer1, 0);
SetPlayerVirtualWorld(DuelPlayer1, 0);

SpawnPlayer(DuelPlayer2);
SetPlayerVirtualWorld(DuelPlayer2, 0);
SetPlayerVirtualWorld(DuelPlayer2, 0);
}

if(Caged[playerid] == 1)
{
Caged[playerid] = 0;
DestroyObject(Cage);
UnCagePlayer(playerid);
}


GotGiftFromBot[playerid] = 0;

if (!IsPlayerNPC(playerid))
{
switch (reason)
{
case 0:format(string, sizeof(string), "* %s (%i) Has Left The Server (Timeout).",PlayerInfo[playerid][pName],playerid);
case 1:format(string, sizeof(string), "* %s (%i) Has Left The Server (Quit).",PlayerInfo[playerid][pName],playerid);
case 2:format(string, sizeof(string), "* %s (%i) Has Left The Server (Kicked).",PlayerInfo[playerid][pName],playerid);
}
}
SendClientMessageToAll(COLOR_DEAD, string);

if(RandomID == playerid)
{
RandomID = -1;

RandomMoney =0;
NoBonusPlayer = 1;
SendClientMessage(playerid, COLOR_WHITE, "* {00B9FF}BONUS: {FF0000}Bonus Player {FFFFFF}Has Been Disconnected.");
}

KillTimer(DaysAliveTimer[playerid]);

if(StatsSaveOnDisConnect[playerid]== 1)
{
if(fexist(UserPath(playerid)))
{
OnSavePlayerStats(playerid);
StatsSaveOnDisConnect[playerid] = 0;
format(string,sizeof(string),"<SAVED> Stats For Account: %s (%d) Has Been Saved Successfully.", PlayerInfo[playerid][pName], playerid);
print(string);
print("SAVING CALLED");
}
}

if(Christmas == 1)
{
if(snowOn{playerid})
{
for(new i = 0; i < MAX_SNOW_OBJECTS; i++) DestroyDynamicObject(snowObject[playerid][i]);
snowOn{playerid} = false;
KillTimer(updateTimer{playerid});
}
}

InDuel[playerid] = 0;

LeaveGroup(playerid, 2);

KillTimer(STATS_SAVE[playerid]);
KillTimer(Antispam_Timer[playerid]);

DirtyWeaponDetected[playerid] = 0;
KillStreakCount[playerid] = 0;

ON_DRUGS[playerid] = 0;
DrugsTaken[playerid] = 0;
AD_PILL_USED[playerid] = 0;

PlayerInfo[playerid][pDrugsTime]=0;
PlayerInfo[playerid][pMuted] = 0;

PlayerInfo[playerid][pAdminlevel] = 0;
PlayerInfo[playerid][pDonator] = 0;
PlayerInfo[playerid][pCash] = 0;
PlayerInfo[playerid][pKills] = 0;
PlayerInfo[playerid][pDeaths] = 0;
PlayerInfo[playerid][pMuted] = 0;
PlayerInfo[playerid][pSkin] = -1;
PlayerInfo[playerid][pSpawned] = 0;
PlayerInfo[playerid][pLogged] = 0;
PlayerInfo[playerid][pCustomDeath] = 0;
PlayerInfo[playerid][pTextdraw] = 0;
PlayerInfo[playerid][pPills] = 0;
PlayerInfo[playerid][pDrugs] = 0;
PlayerInfo[playerid][pHiding] = 0;
PlayerInfo[playerid][pAllowChangePassTime] = 0;
PlayerInfo[playerid][pMathWon] = 0;
PlayerInfo[playerid][pTypingWon] = 0;
PlayerInfo[playerid][pDuelsWon] = 0;
PlayerInfo[playerid][pDuelsLost] = 0;
PlayerInfo[playerid][pAnimation] = 0;

PlayerInfo[playerid][pTeleTime] = 0;
PlayerInfo[playerid][pWaveTime] = 0;
PlayerInfo[playerid][pFoffTime] = 0;
PlayerInfo[playerid][pCryTime] = 0;
PlayerInfo[playerid][pCPRTime] = 0;
PlayerInfo[playerid][pBitchSlapTime] = 0;
PlayerInfo[playerid][pRapeTime] = 0;
PlayerInfo[playerid][pFartTime] = 0;
PlayerInfo[playerid][pFlashTime] = 0;
PlayerInfo[playerid][pComplainTime] = 0;
PlayerInfo[playerid][pSitTime] = 0;
PlayerInfo[playerid][pMournTime] = 0;
PlayerInfo[playerid][pKickTime] = 0;
PlayerInfo[playerid][pPunchTime] = 0;
PlayerInfo[playerid][pHideTime] = 0;
PlayerInfo[playerid][pPukeTime] = 0;
PlayerInfo[playerid][pPissTime] = 0;
PlayerInfo[playerid][pYesTime] = 0;
PlayerInfo[playerid][pPointTime] = 0;
PlayerInfo[playerid][pNoTime] = 0;
PlayerInfo[playerid][pWankTime] = 0;
PlayerInfo[playerid][pStopTime] = 0;
PlayerInfo[playerid][pComeTime] = 0;
PlayerInfo[playerid][pKissTime] = 0;
PlayerInfo[playerid][pFollowTime] = 0;
PlayerInfo[playerid][pRideTime] = 0;
PlayerInfo[playerid][pScratchTime] = 0;
PlayerInfo[playerid][pAskTime] = 0;


PlayerInfo[playerid][pTimesRaped] = 0;
PlayerInfo[playerid][pBonusKills] = 0;
PlayerInfo[playerid][pKillStreaks] = 0;
PlayerInfo[playerid][pFlashKills] = 0;
PlayerInfo[playerid][pRegular] = 0;
PlayerInfo[playerid][pMoneyBags] = 0;
PlayerInfo[playerid][pNoPM] = 0;
PlayerInfo[playerid][pDingSound] = 0;
PlayerInfo[playerid][pShowDamage] = 0;

PlayerInfo[playerid][pChastityBelt] = 0;
PlayerInfo[playerid][pWeaponHolder] = 0;

Warns[playerid] =0;
InSniper[playerid] = 0;
InDMS[playerid] = 0;
InMDM[playerid] = 0;

for(new i; i < MAX_PLAYERS; i++)
{
PlayerIgnoreList[playerid][i] = 0;
PlayerIgnoreList[i][playerid] = 0;
}
return 1;
}
Reply
#2

how many topics about that are you planning to create? One in each section?

As said before:
There is an array called at index -1.
Checkout the values of all variables that you use at indices for arrays.
Might be
DuelPlayer1, DuelPlayer2
Use a printing at the beginning of the callback that shows the values
Код:
printf("Player1 %d, Player2 %d", DuelPlayer1, DuelPlayer2);
if it's one of them, then you've found your problem
If not, then search through that code for other array inidices that might be the faulty spot.
In addition use code or php tags to add your code
Reply
#3

To be absolutely sure you should compile with debug symbols, but to me it looks like
Код:
[debug] #2 000a6588 in ?? (0, 2)
can only point to
PHP код:
LeaveGroup(playerid2); 
So you will have to look in there.

Remember that the stack trace is printed in reverse order, i.e. the first thing that is listed is the last thing that happened.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)