It’s 2021 and I’ve not posted anything in a long time so here goes, 3 years of confusion has amounted to this moment, I’ve always wanted my players to be able to drag other players out of their vehicles, after numerous failed attempts in the past playing with random natives and other strange methods - I finally sussed it, anyone else feel free to chime in and say “I already knew this!” but you never posted it here!
Turns out, the default relationship group the player is set into marks others within the same group relationship type Respect, this means they won’t be able to do certain devious actions such as dragging them out of vehicles and maybe some other stuff, who knows! Setting the relationship type to anything higher than 1 will enable this functionality.
This is good. But how can we sit in passenger seat? I mean in GTA:O if we hold F, we can drag players out of their vehicles. But if you just press the F, your character will sit in passenger seat.
So basically if I just wanted to create it’s own script, it would just look like this for the client.lua right? Figured having it’s own script could come in handy for future needs, if we wanted to change anything between other groups.
I have the types commented out, just there for future reference.
I have quickly coded up a solution, if you hold Shift + F, you will be able to drag the player out the vehicle or punch them out from the passenger side.
Citizen.CreateThread(function()
while true do
if IsControlJustPressed(0, 21) then
SetRelationshipBetweenGroups(2, 'player', 'player')
end
if IsControlJustReleased(0, 21) then
SetRelationshipBetweenGroups(1, 'player', 'player')
end
Citizen.Wait(0)
end
end)