Jump to content

How to stow an hogtied Ped into a Wagon


Stefax71
 Share

Recommended Posts

Hello all!

I hope someone can help me out here! 

I am trying to stow an hogtied ped into a Prison Wagon (WAGONPRISON01X). I tried this task:

 

ped.Tasks.EnterVehicle(_wagon, 5, EnterVehicleFlags.WarpIn)

and it works but only if the ped is able to move (which makes sense). What I would like to accomplish is to be able to stow the hogtied ped I am carrying inside the wagon.  

I lurked around on FiveM docs and found some other functions, all of them, since they are tasks, are working only if the ped is not incapacitated. I tried recreating the ped inside the wagon but even if I pass the model, it uses another random model and the effect is not the best ever.

 

Any hints?

 

Thank you!!!!

 

 

Link to comment
Share on other sites

Ok I think I answered myself. I created this function that does exactly that and it works just fine:

 

public static void SetPedIntoVehicle(Ped ped, Vehicle vehicle, int seatNumber)
{
    Game.CallNative(NativeHashes.VEHICLE.SET_PED_INTO_VEHICLE, ped, vehicle, seatNumber);
}

maybe it was buried somewhere in RPH SDK but I did not really find it! The only thing I had to do was to set:

ped.BlockPermanentEvents = true;

to avoid the ped getting out of the wagon (apparently locking the door did not help) and shoot at me! 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...