09/05/2024 08:48 
	
	
	
		Galera, estou desde ontem monitorando meu servidor e otimizando várias coisas, porém, eu uso uma include: EVF, e tem uma callback OnVehicleTimeUpdate que está sendo chamada muitas vezes e lotando o server.log.
Callback que está na include:
	
	
	
	
Código:
[08:46:38] [debug] #0 00034e28 in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2480
[08:46:38] [debug] Long callback execution detected (hang or performance issue)
[08:46:38] [debug] AMX backtrace:
[08:46:38] [debug] #0 00034ecc in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2482
[08:46:39] [debug] Long callback execution detected (hang or performance issue)
[08:46:39] [debug] AMX backtrace:
[08:46:39] [debug] #0 00035434 in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2501
[08:46:40] [debug] Long callback execution detected (hang or performance issue)
[08:46:40] [debug] AMX backtrace:
[08:46:40] [debug] #0 00034d54 in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2478
[08:46:41] [debug] Long callback execution detected (hang or performance issue)
[08:46:41] [debug] AMX backtrace:
[08:46:41] [debug] #0 00034df0 in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2480
[08:46:41] [debug] Long callback execution detected (hang or performance issue)
[08:46:41] [debug] AMX backtrace:
[08:46:41] [debug] #0 00034e74 in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2481
[08:46:42] [debug] Long callback execution detected (hang or performance issue)
[08:46:42] [debug] AMX backtrace:
[08:46:42] [debug] #0 00034ea8 in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2482
[08:46:43] [debug] Long callback execution detected (hang or performance issue)
[08:46:43] [debug] AMX backtrace:
[08:46:43] [debug] #0 0003542c in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2500
[08:46:44] [debug] Long callback execution detected (hang or performance issue)
[08:46:44] [debug] AMX backtrace:
[08:46:44] [debug] #0 00034da0 in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2479
[08:46:45] [debug] Long callback execution detected (hang or performance issue)
[08:46:45] [debug] AMX backtrace:
[08:46:45] [debug] #0 00034ebc in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2482
[08:46:46] [debug] Long callback execution detected (hang or performance issue)
[08:46:46] [debug] AMX backtrace:
[08:46:46] [debug] #0 00035b30 in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2550
[08:46:47] [debug] Long callback execution detected (hang or performance issue)
[08:46:47] [debug] AMX backtrace:
[08:46:47] [debug] #0 00034d84 in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2478
[08:46:47] [debug] Long callback execution detected (hang or performance issue)
[08:46:47] [debug] AMX backtrace:
[08:46:47] [debug] #0 00034d28 in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2478
[08:46:48] [debug] Long callback execution detected (hang or performance issue)
[08:46:48] [debug] AMX backtrace:
[08:46:48] [debug] #0 00034e5c in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2481
[08:46:49] [debug] Long callback execution detected (hang or performance issue)
[08:46:49] [debug] AMX backtrace:
[08:46:49] [debug] #0 00034e48 in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2480
[08:46:50] [debug] Long callback execution detected (hang or performance issue)
[08:46:50] [debug] AMX backtrace:
[08:46:50] [debug] #0 000353ec in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2500
[08:46:51] [debug] Long callback execution detected (hang or performance issue)
[08:46:51] [debug] AMX backtrace:
[08:46:51] [debug] #0 00035b18 in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2550
[08:46:51] [debug] Long callback execution detected (hang or performance issue)
[08:46:51] [debug] AMX backtrace:
[08:46:51] [debug] #0 00034dc0 in public OnVehicleTimeUpdate () at C:\Users\Administrator\Downloads\GM New Generation RP 1.0\pawno\include\EVF.inc:2479Código:
EVF::Public:: OnVehicleTimeUpdate(){
    new Float:EVF::Vec[4];
    EVF::ForeachVehicle(vehicleid){
        if(EVF::VehicleProperty[vehicleid][e_VEHICLE_STORED]){
            GetVehiclePos(vehicleid,EVF::Vec[0],EVF::Vec[1],EVF::Vec[2]);
            GetVehicleZAngle(vehicleid,EVF::Vec[3]);
            if(IsVehicleSticky(vehicleid)){
                if(VectorSize(EVF::Vec[0]-EVF::VehicleTempData[vehicleid][e_pos_x],EVF::Vec[1]-EVF::VehicleTempData[vehicleid][e_pos_y],EVF::Vec[2]-EVF::VehicleTempData[vehicleid][e_pos_z]) >= 2.0 || VectorSize(EVF::Vec[3]-EVF::VehicleTempData[vehicleid][e_pos_a],0.0,0.0) >= 1.0){
                    return TeleportVehicle(vehicleid,EVF::VehicleTempData[vehicleid][e_pos_x],EVF::VehicleTempData[vehicleid][e_pos_y],EVF::VehicleTempData[vehicleid][e_pos_z],EVF::VehicleTempData[vehicleid][e_pos_a],GetVehicleInterior(vehicleid),GetVehicleVirtualWorld(vehicleid));
                }
            }
            #if defined OnVehiclePosChange
                if(VectorSize(EVF::Vec[0]-EVF::VehicleTempData[vehicleid][e_pos_x],EVF::Vec[1]-EVF::VehicleTempData[vehicleid][e_pos_y],EVF::Vec[2]-EVF::VehicleTempData[vehicleid][e_pos_z]) >= 2.0){
                    if(CallRemoteFunction("OnVehiclePosChange","iffffffff",vehicleid,EVF::Vec[0],EVF::Vec[1],EVF::Vec[2],EVF::Vec[3],EVF::VehicleTempData[vehicleid][e_pos_x],EVF::VehicleTempData[vehicleid][e_pos_y],EVF::VehicleTempData[vehicleid][e_pos_z],EVF::VehicleTempData[vehicleid][e_pos_a])){
                        EVF::VehicleTempData[vehicleid][e_pos_x] = EVF::Vec[0];
                        EVF::VehicleTempData[vehicleid][e_pos_y] = EVF::Vec[1];
                        EVF::VehicleTempData[vehicleid][e_pos_z] = EVF::Vec[2];
                        EVF::VehicleTempData[vehicleid][e_pos_a] = EVF::Vec[3];
                    } else {
                        return TeleportVehicle(vehicleid,EVF::VehicleTempData[vehicleid][e_pos_x],EVF::VehicleTempData[vehicleid][e_pos_y],EVF::VehicleTempData[vehicleid][e_pos_z],EVF::VehicleTempData[vehicleid][e_pos_a],GetVehicleInterior(vehicleid),GetVehicleVirtualWorld(vehicleid));
                    }
                }
            #endif
            GetVehicleVelocity(vehicleid,EVF::Vec[0],EVF::Vec[1],EVF::Vec[2]);
            if(IsVehicleFuelToggled(vehicleid)){
                //fuel system
                new Float:vehicle_speed = EVF::GetVehicleSpeed(vehicleid);
                //if vehicle out of fuel
                if(GetVehicleFuel(vehicleid) <= 0){
                    SetVehicleParams(vehicleid,VEHICLE_TYPE_ENGINE,0);
                    new vehicle_driver = GetVehicleDriverID(vehicleid);
                    if(IsPlayerConnected(vehicle_driver)){
                        GameTextForPlayer(vehicle_driver,"~r~Vehicle out of fuel !",5000,3);
                    }
                } else {
                    //if vehicle has some EVF::Vecitive fuel
                    EVF::VehicleTempData[vehicleid][e_uptime] += 1;
                    if(EVF::VehicleTempData[vehicleid][e_uptime] > 20){ // 250 ms * 20 = 5 seconds
                        EVF::VehicleTempData[vehicleid][e_uptime] = 0;
                        
                        new fuel_consumption_level = 0;
                        if(vehicle_speed == 0.0){
                            if(GetVehicleParams(vehicleid,VEHICLE_TYPE_ENGINE)){
                                fuel_consumption_level = MULTIPLIER_FUEL_SYSTEM;
                            }
                        } else {
                            for(new i = 20, j = floatround(GetVehicleTopSpeed(vehicleid)); i <= j; i += 20){
                                if(vehicle_speed > i){
                                    fuel_consumption_level += MULTIPLIER_FUEL_SYSTEM;
                                }
                            }
                        }
                        
                        if(fuel_consumption_level > 0){
                            new old_fuel = GetVehicleFuel(vehicleid), new_fuel = (old_fuel - fuel_consumption_level - 1);
                            if(new_fuel < 0) new_fuel = 0;
                            CallRemoteFunction("OnVehicleFuelChange","iii",vehicleid,new_fuel,old_fuel);
                            SetVehicleFuel(vehicleid,new_fuel);
                        }
                    }
                }
            }
            
            #if defined OnVehicleVelocityChange
                if(CallRemoteFunction("OnVehicleVelocityChange","iffffff",vehicleid,EVF::Vec[0],EVF::Vec[1],EVF::Vec[2],EVF::VehicleTempData[vehicleid][e_vel_x],EVF::VehicleTempData[vehicleid][e_vel_y],EVF::VehicleTempData[vehicleid][e_vel_z])){
                    EVF::VehicleTempData[vehicleid][e_vel_x] = EVF::Vec[0];
                    EVF::VehicleTempData[vehicleid][e_vel_y] = EVF::Vec[1];
                    EVF::VehicleTempData[vehicleid][e_vel_z] = EVF::Vec[2];
                } else {
                    return SetVehicleVelocity(vehicleid,EVF::VehicleTempData[vehicleid][e_vel_x],EVF::VehicleTempData[vehicleid][e_vel_y],EVF::VehicleTempData[vehicleid][e_vel_z]);
                }
            #endif
            
            GetVehicleHealth(vehicleid,EVF::Vec[0]);
            #if defined OnVehicleHealthChange
                if(EVF::Vec[0] != EVF::VehicleTempData[vehicleid][e_health]){
                    if(CallRemoteFunction("OnVehicleHealthChange","iff",vehicleid,EVF::Vec[0],EVF::VehicleTempData[vehicleid][e_health])){
                        EVF::VehicleTempData[vehicleid][e_health] = EVF::Vec[0];
                    } else {
                        return SetVehicleHealth(vehicleid,EVF::VehicleTempData[vehicleid][e_health]);
                    }
                }
            #endif
        }
    }
    return 1;
}
 
	   
	

 
