Disconnect reason problem
#1

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;
Reply
#2

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"
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)