SA-MP Forums Archive
server crashing (+rep for solution) please!!! - 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: server crashing (+rep for solution) please!!! (/showthread.php?tid=376348)



server crashing (+rep for solution) please!!! - c0smin - 09.09.2012

[10/09/2012 01:09:38] [debug] Run time error 4: "Array index out of bounds"
[10/09/2012 01:09:38] [debug] Accessing element at index 306 past array upper bound 301
[10/09/2012 01:09:38] [debug] AMX backtrace:
[10/09/2012 01:09:38] [debug] #0 00045880 in public OnPlayerStateChange (playerid=16, newstate=2, oldstate=1) at C:\Documents and Settings\cvl\Desktop\sv 0.3e\gamemodes\Gf.pwn:7836

Line:
Код:
        if(newcar == sds1 || newcar == sds2 || newcar == sds3 || newcar == sds4 || newcar == sds5 || newcar == sds6)
        {
          if(TakingLesson[playerid] == 1)
          {
             KillTimer(dmvtimer1);
             SendClientMessage(playerid,COLOR_WHITE,"** Ai la dispozitie {00bfff}75 {ffffff}secunde.");
             SendClientMessage(playerid,COLOR_WHITE,"** Condu cu grija pe partea dreapta si ai grija sa nu lovesti vehiculul.");
             CP[playerid] = 100;
             SetPlayerCheckpoint(playerid, 1042.3046,-1540.3511,13.0649,5.0);
          }
          else
          {
            SendClientMessage(playerid,COLOR_WHITE,"** Ne pare rau, dar acest vehicul este doar pentru cei care dau {00bfff}Scoala de Soferi{ffffff}.");
            RemovePlayerFromVehicle(playerid);
          }
        }
line 7835:else
line 7836:{




2.

[10/09/2012 01:10:55] [debug] Run time error 4: "Array index out of bounds"
[10/09/2012 01:10:55] [debug] Accessing element at index 65535 past array upper bound 499
[10/09/2012 01:10:55] [debug] AMX backtrace:
[10/09/2012 01:10:55] [debug] #0 0001b86c in public OnPlayerDeath (playerid=0, killerid=65535, reason=255) at C:\Documents and Settings\cvl\Desktop\sv 0.3e\gamemodes\Gm.pwn:4257

line 4257: killerteam = gTeam[killerid];



rest...

if (victimteam >= 3 && WantedPoints[playerid] > 0 && killerteam == 2)
{
SetPlayerFree(playerid,killerid, "Got Killed");
}

(+rep for solution) (+rep for solution) (+rep for solution)


Re: server crashing (+rep for solution) please!!! - c0smin - 10.09.2012

+rep !!! (up)


Re: server crashing (+rep for solution) please!!! - Seven_of_Nine - 10.09.2012

Show me OnPlayerDeath and the definition of gTeam


Re: server crashing (+rep for solution) please!!! - c0smin - 10.09.2012

OnPlayerDeath its too big....
ps:

static gTeam[MAX_PLAYERS];


Re: server crashing (+rep for solution) please!!! - c0smin - 11.09.2012

+rep


Re: server crashing (+rep for solution) please!!! - c0smin - 12.09.2012

+rep


Re: server crashing (+rep for solution) please!!! - XtremeR - 12.09.2012

please stop spamming and show onplayerdeath if u want ur problem to be fixed..


Re: server crashing (+rep for solution) please!!! - Lorenc_ - 12.09.2012

pawn Код:
killerteam = IsPlayerConnected( killerid ) ? gTeam[killerid] : NO_TEAM;
Solution for the 2nd one ^