mirror of
https://github.com/Michatec/wk_wars2x.git
synced 2026-04-01 00:16:27 +02:00
feat: func to get ped in opposite seat if driver/passenger
This commit is contained in:
@@ -67,6 +67,17 @@ function PLY:CanControlRadar()
|
|||||||
return self:IsDriver() or ( self:IsPassenger() and RADAR:IsPassengerControlAllowed() )
|
return self:IsDriver() or ( self:IsPassenger() and RADAR:IsPassengerControlAllowed() )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Returns the ped in the opposite seat to the player, e.g. if we're the passenger, then return the driver
|
||||||
|
function PLY:GetOtherPed()
|
||||||
|
if ( self:IsDriver() ) then
|
||||||
|
return GetPedInVehicleSeat( PLY.veh, 0 )
|
||||||
|
elseif ( self:IsPassenger() ) then
|
||||||
|
return GetPedInVehicleSeat( PLY.veh, -1 )
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
-- The main purpose of this thread is to update the information about the local player, including their
|
-- The main purpose of this thread is to update the information about the local player, including their
|
||||||
-- ped id, the vehicle id (if they're in one), whether they're in a driver seat, and if the vehicle's class
|
-- ped id, the vehicle id (if they're in one), whether they're in a driver seat, and if the vehicle's class
|
||||||
-- is valid or not
|
-- is valid or not
|
||||||
|
|||||||
Reference in New Issue
Block a user