14.12.2012, 10:44
Hello, my server is crashing for no (possible) reason. I added crashdetect and got this:
OnPlayerSpawn:
And this:
This is the SetTimerEx i use in OnDialogResponse:
Quote:
[13:00:01] [debug] #3 0001f790 in public OnPlayerSpawn () from CodSamp.amx [13:00:01] [debug] #2 native CallLocalFunction () [080dc980] from samp03svr [13:00:01] [debug] #1 00077e80 in public OnPlPa_OnPlayerSpawn () from CodSamp.amx [13:00:01] [debug] #0 0003fcec in ?? () from CodSamp.amx [13:00:01] [debug] AMX backtrace: [13:00:01] [debug] Accessing element at index 32 past array upper bound 31 [13:00:01] [debug] Run time error 4: "Array index out of bounds" |
pawn Code:
public OnPlayerSpawn(playerid)
{
for(new i=0; i<MAX_ZONES; i++)
{
GangZoneShowForPlayer(playerid, ZoneInfo[i][z_id], GetTeamColor(ZoneInfo[i][z_team]));
if(ZoneTakeOverTeam[i] != -1) GangZoneFlashForPlayer(playerid, ZoneInfo[i][z_id], GetTeamColor(ZoneTakeOverTeam[i]));
}
if(IsSpecing[playerid] == 1)
{
SetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]);
SetPlayerHealth(playerid,SpecHP[playerid]);
SetPlayerInterior(playerid,Inter[playerid]);
SetPlayerVirtualWorld(playerid,vWorld[playerid]);
IsSpecing[playerid] = 0;
IsBeingSpeced[spectatorid[playerid]] = 0;
}
if(gTeam[playerid] == TEAM_USA)
{
TextDrawShowForPlayer(playerid, UsaTxd);
TextDrawHideForPlayer(playerid,GermanyTxd);
TextDrawHideForPlayer(playerid,RussianTxd);
TextDrawHideForPlayer(playerid,JapanTxd);
UsaWeps(playerid);
}
CheckForLevelUpdate(playerid);
if(gTeam[playerid] == TEAM_GERMANY)
{
TextDrawShowForPlayer(playerid, GermanyTxd);
TextDrawHideForPlayer(playerid,UsaTxd);
TextDrawHideForPlayer(playerid,RussianTxd);
TextDrawHideForPlayer(playerid,JapanTxd);
GermanyWeps(playerid);
}
if(gTeam[playerid] == TEAM_RUSSIA)
{
TextDrawShowForPlayer(playerid, RussianTxd);
TextDrawHideForPlayer(playerid,GermanyTxd);
TextDrawHideForPlayer(playerid,JapanTxd);
TextDrawHideForPlayer(playerid,UsaTxd);
RussianWeps(playerid);
}
if(gTeam[playerid] == TEAM_JAPAN)
{
TextDrawShowForPlayer(playerid, JapanTxd);
TextDrawHideForPlayer(playerid,GermanyTxd);
TextDrawHideForPlayer(playerid,RussianTxd);
TextDrawHideForPlayer(playerid,UsaTxd);
JapanWeps(playerid);
}
if(PlayerInfo[playerid][pJailed] == 1 && PlayerInfo[playerid][pLogged] == 1)
{
SetTimerEx("JailRes", 3000, false, "i", playerid);
}
SetPlayerAttachedObject(playerid, 3, 19065, 2, 0.120000, 0.040000, -0.003500, 0, 100, 100, 1.4, 1.4, 1.4);
TextDrawShowForPlayer(playerid, LocationTD[playerid]);
GangZoneShowForPlayer(playerid, UsaGangzone, COLOR_BLUE);
GangZoneShowForPlayer(playerid, GermanyZone, COLOR_RED);
GangZoneShowForPlayer(playerid, RussianZone, COLOR_ORANGE);
GangZoneShowForPlayer(playerid, JapanZone, COLOR_LIGHTGREEN);
SetPlayerInterior(playerid,0);
ClearAnimations(playerid);
SetPlayerHealth(playerid, 90.0);
SetTimerEx("PlayerUnfrozen", 3000, false, "i", playerid);
TogglePlayerControllable(playerid, 0);
SCM(playerid,LIGHTBLUE,"* You are freezed for 3 seconds before spawn. This is to prevent bugs.");
SetPlayerToTeamColour(playerid);
SettingPlayerTeam();
return 1;
}
Quote:
[13:00:43] [debug] Native backtrace: [13:00:43] [debug] #1 000785e4 in public OnDialogResponse () from CodSamp.amx [13:00:43] [debug] #0 native SetTimerEx () [080daf70] from samp03svr [13:00:43] [debug] AMX backtrace: [13:00:43] [debug] Server crashed while executing CodSamp.amx |
pawn Code:
SetTimerEx("CheckBan", 1500, false, "i", playerid);