From d38ca0716feef5c2721abc8a07bfed1fe4639669 Mon Sep 17 00:00:00 2001 From: pindakaastosti Date: Thu, 15 Jun 2023 23:13:05 +0200 Subject: [PATCH] tweak(scripting/csharp): Add ai blip functions --- code/client/clrcore/External/Ped.cs | 114 ++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) diff --git a/code/client/clrcore/External/Ped.cs b/code/client/clrcore/External/Ped.cs index 52e385eb8d..d1c4d5bd44 100644 --- a/code/client/clrcore/External/Ped.cs +++ b/code/client/clrcore/External/Ped.cs @@ -1572,6 +1572,120 @@ public new PedBoneCollection Bones } } + /// + /// Sets the status of the vision cone of the AI Blip + /// + public bool AIBlipConeEnabled + { + set + { + API.SetPedAiBlipHasCone(Handle, value); + } + } + + /// + /// Sets the status if the AI Blip is forced on the map + /// + public bool AIBlipForcedOn + { + set + { + API.SetPedAiBlipForcedOn(Handle, value); + } + } + + /// + /// Sets the gang id of the AI Blip + /// + public int AIBlipGangId + { + set + { + API.SetPedAiBlipGangId(Handle, value); + } + } + + /// + /// Sets the sprite of the AI Blip + /// + public int AIBlipSprite + { + set + { + API.SetPedAiBlipSprite(Handle, value); + } + } + + /// + /// Sets the range of the AI Blip + /// + public float AIBlipRange + { + set + { + API.SetPedAiBlipNoticeRange(Handle, value); + } + } + + /// + /// Enables an AI Blip for this + /// + /// Blip sprite for the AI Blip + public void AIBlipEnable(int sprite) + { + API.SetPedHasAiBlip(Handle, true); + API.SetPedAiBlipSprite(Handle, sprite); + } + + /// + /// Enables an AI Blip for this with color + /// + /// Blip sprite for the AI Blip + /// Color for the AI Blip (see the docs (blip colors)) + public void AIBlipEnable(int sprite, int color) + { + API.SetPedHasAiBlipWithColor(Handle, true, color); + API.SetPedAiBlipSprite(Handle, sprite); + } + + /// + /// Disables the AI Blip of this + /// + public void AIBlipDisable() + { + if (AIBlipIsEnabled()) + { + API.SetPedHasAiBlip(Handle, false); + } + } + + /// + /// Checks if this has an AI Blip + /// + /// True if the ped has an AI Blip + public bool AIBlipIsEnabled() + { + return API.DoesPedHaveAiBlip(Handle); + } + + /// + /// Returns the blip handle of this AI Blip + /// + /// Blip Handle + public int AIBlipGetBlipHandle() + { + return API.GetAiBlip(Handle); + } + + /// + /// Returns the AI Blip as a + /// + /// A object + public Blip AIBlipGetBlipObject() + { + return new Blip(API.GetAiBlip(Handle)); + } + public Vector3 GetLastWeaponImpactPosition() { Vector3 position = new Vector3();