Jump to content
×
×
  • Create New...

Callout trigger when person is near suspect.


Recommended Posts

Writing a small "person with a knife" call out.  Trying to make it to where onStart the ped has his HANDS UP, however whenever the player is within around 6ft of the ped, I want the ped to attack...This is the code I'm trying to use so far:

 public override void OnStart(Ped player)
        {
            base.OnStart(player);
            suspect.Weapons.Give(WeaponHash.Dagger, 1, false, true);
            if (Game.Player.Character.Position.DistanceTo(suspect.Position) < 5f)
                {
                suspect.Task.FightAgainst(player);
            }

          
        }

Link to post
Share on other sites
  • 3 weeks later...

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.   Restore formatting

  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.

  • Recently Browsing   0 members

    No registered users viewing this page.

Important Information

Please view the site: Terms of Use, Privacy Policy, and Guidelines. // IMPORTANT: We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.