SA-MP Forums Archive
Disconnect reason problem - 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: Disconnect reason problem (/showthread.php?tid=449102)



Disconnect reason problem - DaLy - 07.07.2013

pawn Код:
[14:51:40] [debug] Run time error 4: "Array index out of bounds"
[14:51:40] [debug]  Accessing element at index 365 past array upper bound 301
[14:51:40] [debug] AMX backtrace:
[14:51:40] [debug] #0 0001ad78 in public Streamer_OnPlayerDisconnect (playerid=0, reason=1) at pawno\g.pwn:5731
[14:51:40] [debug] #1 native CallLocalFunction () [00471e90] from samp-server.exe
[14:51:40] [debug] #2 00003abc in public Itter_OnPlayerDisconnect (playerid=0, reason=1) at pawno\include\streamer.inc:361
[14:51:40] [debug] #3 native CallLocalFunction () [00471e90] from samp-server.exe
[14:51:40] [debug] #4 000009ac in public OnPlayerDisconnect (playerid=0, reason=1) at pawno\include\foreach.inc:687
[14:51:40] [part] DaLy has left the server (0:1)
streamr.inc
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    Streamer_CallbackHook(STREAMER_OPDC, playerid, reason);
    if (Streamer_g_OPDC)
    {
        return CallLocalFunction("Streamer_OnPlayerDisconnect", "dd", playerid, reason);
    }
    return 1;
}
streamer.inc 361:
pawn Код:
return CallLocalFunction("Streamer_OnPlayerDisconnect", "dd", playerid, reason);
foreach.inc line 687:
pawn Код:
return CallLocalFunction("Itter_OnPlayerDisconnect", "ii", playerid, reason);
g.pwn
pawn Код:
if (gLastCar[playerid] > 0)
    {
        gLastDriver[gLastCar[playerid]] = 900;
        if(PlayerInfo[playerid][pPhousekey] != gLastCar[playerid]-1)
        {
            gCarLock[gLastCar[playerid]] = 0;
        }
    }
g.pwn line 5731
pawn Код:
gLastDriver[gLastCar[playerid]] = 900;



Re: Disconnect reason problem - Konstantinos - 07.07.2013

On the g.pwn file, goto line 5731 and show us 3 lines above and 3 lines below, also comment the line to know exactly which one it is.

The errors says that for example, there's something like
pawn Код:
#define MAX_SOMETHING 302

new
    Something[ MAX_SOMETHING ]
;

// Something can have 0-301
and you pass 365 in it.
pawn Код:
Something[ 365 ] = value; // Run time error 4: "Array index out of bounds"