public OnVehicleDeath(vehicleid, killerid) { printf("%s destroyed", VehicleNames[VehicleModel[vehicleid]-400]); if(IsValidVehicle(vehicleid)) { new Nombre[24], Dueno; for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) { GetPlayerName(i, Nombre, sizeof(Nombre)); if(GetPlayerVehicleAccess(i, vehicleid)) { Dueno = i; } } SFM(Dueno, COLOR_WHITE, "Your %s were destroyed. The goberment sent it to it's parking, but not at all repaired.", VehicleNames[VehicleModel[vehicleid]-400]); vHealth[vehicleid] = 500.0; } return 1; }
public OnVehicleDeath(vehicleid, killerid) { CheatVehicleInfo[vehicleid][elc_vX]=0; #if defined INCLUDE_BASE_MODE return CallLocalFunction("ELC_AC_OnVehicleDeath", "dd",vehicleid, killerid); #else return 1; #endif } /*----------------------------------------------------------------------------*/ #if defined INCLUDE_BASE_MODE //ALS_SYSTEME -------------------- #if defined _ALS_OnVehicleDeath #undef OnVehicleDeath #else #define _ALS_OnVehicleDeath #endif #define OnVehicleDeath ELC_AC_OnVehicleDeath forward ELC_AC_OnVehicleDeath(vehicleid, killerid); #endif
[17:19:28] [debug] Run time error 4: "Array index out of bounds" [17:19:28] [debug] AMX backtrace: [17:19:28] [debug] #0 00066214 in public ELC_AC_OnVehicleDeath (vehicleid=12, killerid=0) at F:\Users\ByMatt20030\Desktop\San Jose\Scrath-RP 0.0.20\gamemodes\S-RP_Traducida.pwn:1390 [17:19:28] [debug] #1 native CallLocalFunction () from samp-server.exe [17:19:28] [debug] #2 00059df4 in public OnVehicleDeath (vehicleid=12, killerid=0) at F:\Users\ByMatt20030\Desktop\San Jose\Scrath-RP 0.0.20\pawno\include\ELC_AC_BASE.inc:1186
return CallLocalFunction("ELC_AC_OnVehicleDeath", "dd",vehicleid, killerid);
SFM(Dueno, COLOR_WHITE, "Your %s were destroyed. The goberment sent it to it's parking, but not at all repaired.", VehicleNames[VehicleModel[vehicleid]-400]);
Код:
SFM(Dueno, COLOR_WHITE, "Your %s were destroyed. The goberment sent it to it's parking, but not at all repaired.", VehicleNames[VehicleModel[vehicleid]-400]); It could cause trouble in the future. If anything, that line, should be 'in' the loop, so if the car isn't owned by anyone it won't fire. That, or have a check to ensure that if the player isn't found, then it won't fire, such as setting Dueno to -1, and checking if it's not -1 before making the announcement. |