12.02.2018, 04:38
Hi, my problem is when a passenger is pause and driver pulls the vehicle, OnUnoccupiedVehicleUpdate isn't called.
I want to make the vehicle stoped when driver pulls the vehicle, but this does not happen because the passenger is paused.
My code
Sorry for my english, thanks
I want to make the vehicle stoped when driver pulls the vehicle, but this does not happen because the passenger is paused.
Код HTML:
new UNON = 1; public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z) { if(UNON == 1) { new Float:PosX,Float:PosY,Float:PosZ,Float:PosA; GetVehiclePos(vehicleid, PosX, PosY, PosZ); GetVehicleZAngle(vehicleid, PosA); new Float:Distancia = GetDistanceBetweenPoints(new_x, Float:new_y, Float:new_z, PosX, PosY, PosZ); if(Distancia > 20.0) { SetVehiclePos(vehicleid, PosX, PosY, PosZ); SetVehicleZAngle(vehicleid, PosA); return ; } } else { static Float:distance,Float:pos_x,Float:pos_y,Float:pos_z,Float:angle; GetVehiclePos(vehicleid, pos_x, pos_y, pos_z); GetVehicleZAngle(vehicleid, angle); distance = VectorSize(pos_x - new_x, pos_y - new_y, pos_z - new_z); if(distance > 10 && pos_z > -70.0) { SetVehiclePos(vehicleid, pos_x, pos_y, pos_z); SetVehicleZAngle(vehicleid, angle); } } }
Sorry for my english, thanks