feat: add function to get other ped's server id

This commit is contained in:
Dan
2021-03-11 18:50:45 +00:00
parent b7168ef658
commit a06972c57d

View File

@@ -78,6 +78,18 @@ function PLY:GetOtherPed()
return nil
end
function PLY:GetOtherPedServerId()
local otherPed = self:GetOtherPed()
if ( otherPed ~= nil and otherPed ~= 0 and IsPedAPlayer( otherPed ) ) then
local otherPly = GetPlayerServerId( NetworkGetPlayerIndexFromPed( otherPed ) )
return otherPly
end
return nil
end
-- 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
-- is valid or not