mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 00:16:27 +02:00
feat(sync): add code for triggering sync on entering a vehicle
This commit is contained in:
@@ -89,6 +89,25 @@ Citizen.CreateThread( function()
|
|||||||
PLY.inPassengerSeat = GetPedInVehicleSeat( PLY.veh, 0 ) == PLY.ped
|
PLY.inPassengerSeat = GetPedInVehicleSeat( PLY.veh, 0 ) == PLY.ped
|
||||||
PLY.vehClassValid = GetVehicleClass( PLY.veh ) == 18
|
PLY.vehClassValid = GetVehicleClass( PLY.veh ) == 18
|
||||||
|
|
||||||
|
Citizen.Wait( 500 )
|
||||||
|
end
|
||||||
|
end )
|
||||||
|
|
||||||
|
Citizen.CreateThread( function()
|
||||||
|
while ( true ) do
|
||||||
|
if ( IsPedGettingIntoAVehicle( PLY.ped ) ) then
|
||||||
|
UTIL:Notify( "DEBUG: Player getting in vehicle" )
|
||||||
|
local vehEntering = GetVehiclePedIsEntering( PLY.ped )
|
||||||
|
|
||||||
|
Citizen.Wait( 2000 )
|
||||||
|
|
||||||
|
local veh = GetVehiclePedIsIn( PLY.ped, false )
|
||||||
|
|
||||||
|
if ( veh == vehEntering ) then
|
||||||
|
UTIL:Notify( "DEBUG: Trigger sync" )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
Citizen.Wait( 500 )
|
Citizen.Wait( 500 )
|
||||||
end
|
end
|
||||||
end )
|
end )
|
||||||
Reference in New Issue
Block a user