Log in to reply
 

[C#] Arrest Player Assistance



  • I was curious why I can't make any script spawned police arrest the player @ 1 star like dispatch.meta police. For instance I spawn S_M_Y_Cop_01 and just for good measure I use Function.Call(Hash.SET_PED_AS_COP, ped, true); however @ 1 star instead of trying to arrest me they shoot. I was hoping the game would naturally task them to arrest me without having to assign tasks.

    So then I decided I would task them to arrest me. I've tried ped.Task.ClearAll() followed by ped.Task.Arrest and still they shoot instead of trying to arrest me.

    Any ideas?

    Try this yourself. Via script spawn a cop model then give yourself a one star wanted level. Do they shoot you or do they try to arrest you like they should?


  • MODERATOR

    It's tricky because both your script and the game are giving tasks to the cop ped(s). You may have to call the task multiple times. If you haven't already, try:

    if (!Function.Call<bool>(Hash.IS_PED_RUNNING_ARREST_TASK, ped))
    {
    ped.Task.Arrest(Game.Player.Character);
    }


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.