public OnUnoccupiedVehicleUpdate( vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z )
{
print( "OnUnoccupiedVehicleUpdate - 1" ); // this is called
if( !GetVehicleRespawnDelay( vehicleid ) ) // this line is crashing, even if I remove the checking, leaving only the function, without returning anything
return 1;
print( "OnUnoccupiedVehicleUpdate - 2" ); // this is not called
// etc.
return 1;
}
#if !defined GetVehicleRespawnDelay
stock GetVehicleRespawnDelay( vehicleid )
{
print( "RespawnDelay - 1" ); // This is not called at all
if( !IsValidVehicle( vehicleid ) )
return 0;
return GetGVarInt( "VehicleRespawnDelay", vehicleid );
}
#endif
[02/02/2015 16:29:04] OnUnoccupiedVehicleUpdate - 1
[02/02/2015 16:29:04] [debug] Run time error 6: "Invalid instruction"
[02/02/2015 16:29:04] [debug] Unknown opcode 0xfffffffc at address 0x0001265C
[02/02/2015 16:29:04] [debug] AMX backtrace:
[02/02/2015 16:29:04] [debug] #0 0001265c in public OnUnoccupiedVehicleUpdate (vehicleid=857, playerid=0, passenger_seat=0, Float:new_x=980.89001, Float:new_y=1741.81006, Float:new_z=8.92888, Float:vel_x=0.00000, Float:vel_y=0.00000, Float:vel_z=-0.04079) at mSelection.inc:157
Looks like a memory corruption problem as far as I can see (stack I think, I'm no expert on this but I've experienced that problem a few times). Basically, you've probably got a native function somewhere writing out of an array's bounds and native functions don't raise errors or do any range checking if they are out of bounds annoyingly. I'm not too certain on how to debug it, I just got lucky when I had this issue and managed to find the line that caused it (it was strcat writing to a 16 cell local array with a 32 cell input, those extra 16 cells were being written into somewhere else in memory and screwing up an instruction call or something).
|
Is that the whole call stack, because it doesn't make much sense...
|
stock Float: GetDistanceBetweenPlayers (p1, p2) { new Float: x1, Float: y1, Float: z1, float x2, float y2, Float: z2; if (IsPlayerConnected (p1) || IsPlayerConnected (p2)!) return -1.00; GetPlayerPos (p1, x1, y1, z1); GetPlayerPos (p2, x2, y2, z2); return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2)); }
stock Float: GetDistanceBetweenPlayers (p1, p2) { new Float: x1, Float: y1, Float: z1, float x2, float y2, Float: z2; if (IsPlayerConnected (p1) || IsPlayerConnected (p2)!) return -1.00; GetPlayerPos (p1, x1, y1, z1); GetPlayerPos (p2, x2, y2, z2); return VectorSize (x1-x2, y1-y2, z1-z2); }
@RubenZone: Update to the latest crashdetect version. I fixed that Debug_Print0 bug ages ago.
|
[debug] Server crashed while executing GC.amx [debug] AMX backtrace: [debug] #0 00000038 in INI_AddToBuffer (INI:file=51, name[]=@00000000 "", data[]=@01f824e4 "0000001424370853") at <unknown file>:0 [debug] #1 00014600 in ?? (... <13 arguments>) at C:\Users\Dennys Sachez\Desktop\nuevo servidor 2015\pawno\include\YSI\y_ini.inc:1076 [debug] #2 00000038 in public severTimers2@_yT () at <unknown file>:0
timer severTimers2[1000]() { foreach(Player, i) { if(IsPlayerConnected(i) && gPlayerLogged[i] == 1) { if(Info[i][pTimePayDay] >= 0) { new string[128]; Info[i][pTimePayDay]++; if(Info[i][pTimePayDay] >= 3600) // es hora de payday { new tmpintrate, interest, paytotal; tmpintrate = 1; interest = (Info[i][pAccount]/1000)*(tmpintrate); // paytotal = Info[i][pPayCheck]-TaxValue; if(Info[i][pVIP] == 0 && interest > 50000) interest = 50000; else if(Info[i][pVIP] == 1 && interest > 100000) interest = 100000; else if(Info[i][pVIP] == 2 && interest > 150000) interest = 150000; else if(Info[i][pVIP] == 3 && interest > 200000) interest = 200000; else if(Info[i][pVIP] >= 4 && interest > 250000) interest = 250000; Info[i][pAccount] += interest; if(Info[i][p_Pr_Time] == 10) SendClientMessageEx(i, COLOR_BLANCO, " Ya puedes volver hacer viajes de Transportista."), Info[i][p_Pr_Time] = 0; if(Info[i][pRenting] != NOEXISTE) { if(HouseInfo[Info[i][pRenting]][hRentFee] > Info[i][pAccount]) Info[i][pRenting] = NOEXISTE, SendClientMessageEx(i, COLOR_BLANCO, "Fuiste desalojado de la casa que rentabas."); else HouseInfo[Info[i][pRenting]][hSafeMoney] += HouseInfo[Info[i][pRenting]][hRentFee], Info[i][pAccount] -= HouseInfo[Info[i][pRenting]][hRentFee]; } Info[i][pRob] = 0; if(Info[i][pVIP] >= 4) Info[i][pVTokens]+= 2; if(Info[i][pDobleExp] == 0) Info[i][pExp] += 1; else { Info[i][pExp] += 2; Info[i][pDobleExp]--; format(string, sizeof(string), "* Ganaste 2 puntos de respeto por tener horas de doble experiencia, te quedan %d horas mбs.", Info[i][pDobleExp]); SendClientMessageEx(i, COLOR_YELLOW, string); } SendClientMessageEx(i, COLOR_GENERAL, "|______ DНA DE PAGA - Estado Bancario _____|"); format(string, sizeof(string), " Nombre: %s ", NombreIC(i));//pagos de payday SendClientMessageEx(i, COLOR_BLANCO, string); format(string, sizeof(string), " Pago: $%d | Impuestos : -$%d", 50*Info[i][pLevel], TaxValue);//pagos de payday SendClientMessageEx(i, COLOR_BLANCO, string); format(string, sizeof(string), " Interйs ganado: 0.%d por ciento", interest); SendClientMessageEx(i, COLOR_BLANCO, string); format(string, sizeof(string), " Pago de Facc/fam: %d ", 50*Info[i][pRank]); SendClientMessageEx(i, COLOR_BLANCO, string); Info[i][pAccount] += paytotal; format(string, sizeof(string), " Total: $%d | N. Balance : %d$", paytotal, Info[i][pAccount]); SendClientMessageEx(i, COLOR_BLANCO, string); if(Info[i][pSubCNN] == 1) SendClientMessageEx(i, COLOR_BLANCO, " Pago de la subscripcion: -$100"), Info[i][pAccount] -= 100; SendClientMessageEx(i, COLOR_GENERAL, "|---------------------------------------------|"); // Info[i][pPayCheck] = 0; Info[i][pTimePayDay] = 0; Info[i][pConnectTime] += 1; //RewardPlayer(i); OnPlayerSavedStats(i); GameTextForPlayer(i, "~b~+1 ~w~Respeto", 5000, 1); if(Info[i][pConnectTime] == 2) Info[i][pWRestricted] = 0, SendClientMessageEx(i, COLOR_LIGHTRED, "Han pasado 2 horas, ya no tienes restricciуn de armas."); if(Info[i][pWRestricted] > 0) Info[i][pWRestricted]--; } } if(GetPlayerPing(i) > MAX_PING) { new string[128]; format(string, sizeof(string), "[ADMINISTRACIУN] %s ha sido expulsado por tener %d de ping (maximo: %d).", NombreIC(i), GetPlayerPing(i), MAX_PING); ABroadCast(COLOR_GENERAL, string, 1); SendClientMessageEx(i, COLOR_GENERAL, "SERVER: "COL_BLANCO"Has sido expulsado del servidor, tu ping superу el mбximo."); Expulsar(i); } if(Info[i][pJudgeJailType] != 0 && Info[i][pJudgeJailTime] > 0 && !Info[i][pBeingSentenced]) Info[i][pJudgeJailTime]--; if(Info[i][pJudgeJailTime] <= 0 && Info[i][pJudgeJailType] != 0) Info[i][pJudgeJailType] = 0; if(IsaRent[i] > 0) { if(RentTime[i] > 0) RentTime[i]--; if(RentTime[i] == 0) { RentTime[i] = 0; if(IsaRent[i] == 1) { IsaRent[i] = 0; new newcar = GetPlayerVehicleID(i); if(IsARentCar(newcar)) SetVehicleToRespawn(HireKey[i]), TogglePlayerControllable(i, 1); } } } if(CommandSpamUnmute[i] == 0) CommandSpamTimes[i] = 0; if(Info[i][pADTime] != 0) Info[i][pADTime]--; if(Info[i][pServiceTime] != 0) Info[i][pServiceTime]--; if(NewbieTimer[i] > 0) NewbieTimer[i]--; if(VIPTimer[i] > 0) VIPTimer[i]--; if(Info[i][pDPTime] != -1) { Info[i][pDPTime]--; if(Info[i][pDPTime] == 0) { Info[i][pDPHours] = 0; Info[i][pRHours] = 0; Info[i][pDPTime] = -1; SendClientMessageEx(i, COLOR_GREEN,"* Se terminу tu tiempo, no pudiste mantener el beneficio de Usuario Dedicado, intentalo de nuevo!"); } } if(GetPlayerCash(i) != GetPlayerMoney(i)) ResetMoneyBar(i), UpdateMoneyBar(i,GetPVarInt(i, "Cash")); if(Info[i][pTriageTime] != 0) Info[i][pTriageTime]--; if(Info[i][pTempVIP] >= 1) Info[i][pTempVIP]--; if(Info[i][pTempVIP] <= 0 && Info[i][pBuddyInvited] == 1) { Info[i][pTempVIP] = 0; Info[i][pBuddyInvited] = 0; Info[i][pVIP] = 0; SendClientMessageEx(i, COLOR_VIP, "INFO: "COL_BLANCO"Tu VIP Temporal ha expirado."); SetPlayerToTeamColor(i); } if(Info[i][pRMuted] > 1) { if(Info[i][pRMutedTime] > 0) Info[i][pRMutedTime]--; else Info[i][pRMuted] = 0; } if(Info[i][pJailed] > 0) { if(Info[i][pJailTime] > 0) { Info[i][pJailTime]--; new text[128]; switch(Info[i][pJailed]) { case 1, 4: format(text, sizeof(text), "~n~~n~~n~~n~~n~~n~~n~ ~r~Jail Administrativa!~n~~w~%d segundos (%i minutos) restantes", Info[i][pJailTime], Info[i][pJailTime]/60); } GameTextForPlayer(i, text, 2000, 3); } if(Info[i][pJailTime] <= 0) { Info[i][pJailTime] = 0; switch(Info[i][pJailed]) { case 2: { SetPosEx(i,1538.7266,-1682.7545,13.5469,0,0,0); Info[i][pWantedLevel] = 0; SetPlayerWantedLevel(i, Info[i][pWantedLevel]); } case 3: { SetPlayerInterior(i, 0); Info[i][pInt] = 0; SetPlayerVirtualWorld(i, 0); Info[i][pVW] = 0; SetPlayerPos(i,343.1081,-1521.4404,33.2985); } case 1,4: { SetPlayerInterior(i, 0); Info[i][pInt] = 0; LoadObjects(i); SetPosEx(i,1541.4155,-1675.9213,13.5525,0,0,0); } case 5: { SetPlayerInterior(i, 0); Info[i][pInt] = 0; SetPlayerVirtualWorld(i, 0); Info[i][pVW] = 0; SetPlayerPos(i,130.0132,1945.5618,19.3507); } case 6: { SetPlayerInterior(i, 0); Info[i][pInt] = 0; SetPlayerVirtualWorld(i, 0); Info[i][pVW] = 0; SetPlayerPos(i,614.4990,-585.9028,17.2266); } case 1000: { SetPlayerInterior(i, 0); Info[i][pInt] = 0; LoadObjects(i); SetPosEx(i,1541.4155,-1675.9213,13.5525,0,0,0); } } Info[i][pJailed] = 0; PhoneOnline[i] = 0; SendClientMessageEx(i, COLOR_GREEN,"Has pagado tu condena."); GameTextForPlayer(i, "~g~Acabas de salir de prision administrativa, ~n~Que no vuelva ha suceder.", 5000, 1); SetPlayerSkin(i, Info[i][pChar]); SetPlayerToTeamColor(i); } } if(Info[i][pWantedLevel] > 0) SetPlayerWantedLevel(i, Info[i][pWantedLevel]); if(UsedFind[i] >= 1) UsedFind[i] -= 1; if(JustReported[i] > 0) JustReported[i]--; if(Info[i][pGiftTime] != 0) Info[i][pGiftTime]--; if(PlayerTazeTime[i] >= 1) { PlayerTazeTime[i] += 1; if(PlayerTazeTime[i] == 15)PlayerTazeTime[i] = 0; } if(MechanicCallTime[i] > 0) { if(MechanicCallTime[i] == 60) { MechanicCallTime[i] = 0; DisablePlayerCheckpoint(i); PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0); GameTextForPlayer(i, "~r~Checkpoint eliminado!", 2500, 1); } else { new string[5]; format(string, sizeof(string), "%d", 30 - MechanicCallTime[i]); GameTextForPlayer(i, string, 1500, 6); MechanicCallTime[i] += 1; } } if(MedicCallTime[i] > 0) { if(MedicCallTime[i] == 45) { MedicCallTime[i] = 0; DisablePlayerCheckpoint(i); PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0); GameTextForPlayer(i, "~r~Checkpoint eliminado!", 2500, 1); } else { new string[5]; format(string, sizeof(string), "%d", 45 - MedicCallTime[i]); new Float:X,Float:Y,Float:Z; GetPlayerPos(MedicAccepted[i], X, Y, Z); SetPlayerCheckpoint(i, X, Y, Z, 5); GameTextForPlayer(i, string, 1500, 6); MedicCallTime[i] += 1; } } if(GetPlayerState(i) == PLAYER_STATE_ONFOOT) for(new h = 0; h < sizeof(fINFO); h++) { if(IsPlayerInRangeOfPoint(i, 2.0, fINFO[h][FamilySafe][0], fINFO[h][FamilySafe][1], fINFO[h][FamilySafe][2])) { if(fINFO[h][FamilyUSafe] == 1) GameTextForPlayer(i, "~y~Caja Fuerte~w~~n~Escribe ~r~/ayudasafe~w~ para mas informacion", 5000, 3); } } if(EMSCallTime[i] > 0) { if(EMSAccepted[i] < 999) { if(IsPlayerConnected(EMSAccepted[i])) { new Float:X,Float:Y,Float:Z; GetPlayerPos(EMSAccepted[i], X, Y, Z); SetPlayerCheckpoint(i, X, Y, Z, 5); } } } if(Info[i][pEstado] == 1) { if(PlayerCuffedTime[i] <= 0) { //Frozen[i] = 0; SetPVarInt(i, "IsFrozen", 0); TogglePlayerControllable(i, 1); Info[i][pEstado] = 0; SetPVarInt(i, "PlayerCuffed", 0); PlayerCuffedTime[i] = 0; PlayerTazeTime[i] = 1; ClearAnimations(i); new Float:X, Float:Y, Float:Z; GetPlayerPos(i, X, Y, Z); SetPlayerPos(i, X, Y, Z); } else PlayerCuffedTime[i] -= 1; } if(Info[i][pEstado] == 2) { if(PlayerCuffedTime[i] <= 0) { new Float:X, Float:Y, Float:Z; GetPlayerPos(i, X, Y, Z); new copinrange; foreach(Player, j) { if(IsPlayerInRangeOfPoint(j, 30, X, Y, Z) && IsACop(j)) copinrange = 1; } if(copinrange == 0) { //Frozen[i] = 0; SetPVarInt(i, "IsFrozen", 0); GameTextForPlayer(i, "~r~Rompiste las esposas eres libre!", 2500, 3); TogglePlayerControllable(i, 1); Info[i][pEstado] = 0; DeletePVar(i, "PlayerCuffed"); PlayerCuffedTime[i] = 0; } else PlayerCuffedTime[i] = 60; } else PlayerCuffedTime[i] -= 1; } if(PlayerDrunk[i] > 9) { if(PlayerDrunkTime[i] > 20) { ApplyAnimation(i,"PED", "WALK_DRUNK",6.0,0,1,0,0,PlayerDrunk[i]*1000); SetPlayerDrunkLevel(i, PlayerDrunk[i]*1000); PlayerDrunk[i] -= 1; PlayerDrunkTime[i] = 0; } PlayerDrunkTime[i] += 1; } if(PlayerDrunk[i] < 10 && PlayerDrunk[i] > 0) { if(PlayerDrunkTime[i] > 30) PlayerDrunk[i] -= 1,PlayerDrunkTime[i] = 0; PlayerDrunkTime[i] += 1; } } } }
[04:34:50] [debug] Run time error 4: "Array index out of bounds" [04:34:50] [debug] Accessing element at index 18 past array upper bound 17 [04:34:50] [debug] AMX backtrace: [04:34:50] [debug] #0 000b10a8 in public Streamer_OnGameModeInit () from MNX.amx [04:34:50] [debug] #1 native CallLocalFunction () from samp-server.exe [04:34:50] [debug] #2 0000128c in public Itter_OnGameModeInit () from MNX.amx [04:34:50] [debug] #3 native CallLocalFunction () from samp-server.exe [04:34:50] [debug] #4 00000870 in public OnGameModeInit () from MNX.amx