20.03.2016, 08:28
My vehicle pool is 1475.
This command takes 15 seconds to execute on my home host, and a few on linux.
I recently added IsValidVehicle(i), that IS NOT slowing it down.
If you remove SetVehicleToRespawn, the loop takes 0 ms. But when you add SetVehicleToRespawn.. idk whats happening man.
This guy complained about the same issue https://sampforum.blast.hk/showthread.php?tid=575688.
pawn Код:
respawnAllVehicles()
{
new bool:vehicleActivityStatus[MAX_VEHICLES] = {false, ...}, pCurVehicleID = INVALID_VEHICLE_ID;
foreach(new i : Character)
{
if(playerData[i][pCurrentVehicleDrivenID] != INVALID_VEHICLE_ID) {
pCurVehicleID = playerData[i][pCurrentVehicleDrivenID];
}
else if(IsPlayerInAnyVehicle(i)) {
pCurVehicleID = GetPlayerVehicleID(i);
}
if(pCurVehicleID != INVALID_VEHICLE_ID) {
vehicleActivityStatus[pCurVehicleID] = true;
if(IsTrailerAttachedToVehicle(pCurVehicleID)) {
vehicleActivityStatus[GetVehicleTrailer(pCurVehicleID)] = true;
}
}
pCurVehicleID = INVALID_VEHICLE_ID;
}
for(new i = 0, j = GetVehiclePoolSize(); i < j; i++) {
if(IsValidVehicle(i) && vehicleActivityStatus[i] == false) {
SetVehicleToRespawn(i);
}
}
return;
}
I recently added IsValidVehicle(i), that IS NOT slowing it down.
If you remove SetVehicleToRespawn, the loop takes 0 ms. But when you add SetVehicleToRespawn.. idk whats happening man.
This guy complained about the same issue https://sampforum.blast.hk/showthread.php?tid=575688.