Jump to content

A DEFAULT CALLOUT PRESET


Jesyx

Recommended Posts

This is a default Callout Preset

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Rage;
using LSPD_First_Response.Mod.API;
using LSPD_First_Response.Mod.Callouts;
 
namespace CALLOUTPACKNAME.Callouts
{
    [CalloutInfo("CALLOUT NAME HERE", CalloutProbability.Medium)]
    public class CALLOUT NAME HERE : Callout
    {
        //ASSETS
 
        private Vector3 SpawnPoint;
 
        //CALLOUT MESSAGE
 
        public override bool OnBeforeCalloutDisplayed()
        {
            SpawnPoint = new Vector3 (-975, -2700 ,14);
            ShowCalloutAreaBlipBeforeAccepting(SpawnPoint, 30f); AddMinimumDistanceCheck(20f, SpawnPoint);
            CalloutMessage = "CALLOUT NAME HERE"; CalloutPosition = SpawnPoint;
 
            //ON AND BEFORE CALLOUT HAS ACCEPTED
 
            Functions.PlayScannerAudio("WE_HAVE CRIME_GRAND_THEFT_AUTO IN_05 AREA_LOS_SANTOS_INTERNATIONAL_02");
 
            return base.OnBeforeCalloutDisplayed();
        }
 
       
        public override bool OnCalloutAccepted()
        {
            Functions.PlayScannerAudio("RESPOND_CODE_3");
           
            //SET UP FOR CALLOUT
 
            return base.OnCalloutAccepted();
        }
 
        public override void Process()
        {
            base.Process();
 
            //THINGS PLAY OUT HERE
 
            End();
        }
 
        public override void End()
        {
            base.End();
            //DELETE STUFF HERE
        }
    }
}

I hope this was a help

Edited by Jesyx

🇨🇦🇳🇱🇺🇦 Слава Україні! 🇺🇦🇳🇱🇨🇦

🇨🇦🇳🇱🇺🇦 Героям слава! 🇺🇦🇳🇱🇨🇦

Link to comment
Share on other sites

  • 1 month later...
On 2/12/2019 at 5:08 PM, WildJam said:

Yes, this helped me, thank u very much, but do u know how to make passangers in the vehicle and shooting to police?

You can add Tasks with Ped.Task.ShootingAtCharacter or something like that, you can also set relationships but I'm not sure exactly how 

🇨🇦🇳🇱🇺🇦 Слава Україні! 🇺🇦🇳🇱🇨🇦

🇨🇦🇳🇱🇺🇦 Героям слава! 🇺🇦🇳🇱🇨🇦

Link to comment
Share on other sites

2 minutes ago, WildJam said:

I already do a passanger, i will try "Ped.Task.ShootingAtCharacter" thanks.

G'luck

🇨🇦🇳🇱🇺🇦 Слава Україні! 🇺🇦🇳🇱🇨🇦

🇨🇦🇳🇱🇺🇦 Героям слава! 🇺🇦🇳🇱🇨🇦

Link to comment
Share on other sites

8 hours ago, WildJam said:

K, then do u know how to check the ped is dead? i want to make blip deleted when ped is dead, beacuse blip is deleting when callout ended

 

i tried


if (Suspect.IsDead)() { Suspect.Dismiss(); }

// or

if (Suspect.IsDead)() { SuspectBlip.Delete(); }

 

if (Suspect.IsDead()) {Blip.Delete();}

 

🇨🇦🇳🇱🇺🇦 Слава Україні! 🇺🇦🇳🇱🇨🇦

🇨🇦🇳🇱🇺🇦 Героям слава! 🇺🇦🇳🇱🇨🇦

Link to comment
Share on other sites

3 hours ago, Jesyx said:

if (Suspect.IsDead()) {Blip.Delete();}

 

K i tried does not works, there is error:

Non-invocable member 'Entity.IsDead' cannot be used like a method.

but, how to give u reputation?

 

and how i can make callout spawning when only near the spawnpoint

Edited by WildJam
Link to comment
Share on other sites

23 hours ago, WildJam said:

K i tried does not works, there is error:


Non-invocable member 'Entity.IsDead' cannot be used like a method.

but, how to give u reputation?

 

and how i can make callout spawning when only near the spawnpoint

try

if (Suspect.IsDead) {Blip.Delete();}

 

🇨🇦🇳🇱🇺🇦 Слава Україні! 🇺🇦🇳🇱🇨🇦

🇨🇦🇳🇱🇺🇦 Героям слава! 🇺🇦🇳🇱🇨🇦

Link to comment
Share on other sites

38 minutes ago, Jesyx said:

try


if (Suspect.IsDead) {Blip.Delete();}

 

I found a way yesterday, its:

 

            if (Suspect.IsCuffed || Suspect.IsDead)
            {
                { SuspectBlip.Delete(); }
            }

What i really need now, is make callout starts when near spawnpoint and make peds shooting on other cops

Edited by WildJam
Link to comment
Share on other sites

On 2/18/2019 at 2:06 PM, WildJam said:

Do u know how to check is the player is in given location?

 

On 2/18/2019 at 6:32 PM, NoNameSet said:

you can always check the zone/area of the entities current location.

You can try 

if (Game.LocalPlayer.Character.DistanceTo(PlayerPosition) < 10)
{
	do shit
}

 this is highly recommended to do in a while loop

			while (true)
            {
                GameFiber.Yield();
                
				this will repeat until you do
				break;
            }

the GameFiber.Yield(); insures your game doesnt crash

 

Edited by Jesyx

🇨🇦🇳🇱🇺🇦 Слава Україні! 🇺🇦🇳🇱🇨🇦

🇨🇦🇳🇱🇺🇦 Героям слава! 🇺🇦🇳🇱🇨🇦

Link to comment
Share on other sites

19 hours ago, Jesyx said:

 

You can try 


if (Game.LocalPlayer.Character.DistanceTo(PlayerPosition) < 10)
{
	do shit
}

 this is highly recommended to do in a while loop


			while (true)
            {
                GameFiber.Yield();
                
				this will repeat until you do
				break;
            }

the GameFiber.Yield(); insures your game doesnt crash

 

I need help, please reply to me. I have problem. I have multiple peds and blips, when i kill does not metter which ped, his blip is deleted, but why when i want to kill second ped, blip does not want to delete? i told, does not matter which ped i kill.(this is not pursuit)

 

My code:

            // my blips codes:
            myBlip = myPed.AttachBlip();
            myBlip.IsFriendly = false;
            myBlip.Scale = 1f;

            myBlip = myPed.AttachBlip();
            myBlip.IsFriendly = false;
            myBlip.Scale = 1f;
            // and more...

// this code deleting blips
            if (myPed.IsCuffed || myPed.IsDead)
            {
                { myBlip.Delete(); }
            }

            if (myPed.IsCuffed || myPed.IsDead)
            {
                { myBlip.Delete(); }
            }
            // and more...

Im waiting.

Edited by WildJam
Link to comment
Share on other sites

On 2/20/2019 at 5:03 PM, WildJam said:

I need help, please reply to me. I have problem. I have multiple peds and blips, when i kill does not metter which ped, his blip is deleted, but why when i want to kill second ped, blip does not want to delete? i told, does not matter which ped i kill.(this is not pursuit)

 

My code:


            // my blips codes:
            myBlip = myPed.AttachBlip();
            myBlip.IsFriendly = false;
            myBlip.Scale = 1f;

            myBlip = myPed.AttachBlip();
            myBlip.IsFriendly = false;
            myBlip.Scale = 1f;
            // and more...

// this code deleting blips
            if (myPed.IsCuffed || myPed.IsDead)
            {
                { myBlip.Delete(); }
            }

            if (myPed.IsCuffed || myPed.IsDead)
            {
                { myBlip.Delete(); }
            }
            // and more...

Im waiting.

Mabey it ends the callout for some reason, if you want help from more experienced people than me you should post it in the API forum

🇨🇦🇳🇱🇺🇦 Слава Україні! 🇺🇦🇳🇱🇨🇦

🇨🇦🇳🇱🇺🇦 Героям слава! 🇺🇦🇳🇱🇨🇦

Link to comment
Share on other sites

1 hour ago, Jesyx said:

Mabey it ends the callout for some reason, if you want help from more experienced people than me you should post it in the API forum

i posted, nobody reply to me. 

 

and, i understand it like that, i can make only codes respecting only one ped, beacuse when i make other code respecting other ped, then its does not works.

and when i delete earlier code, then other works. im making callout with searching area.

 

my code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Rage;
using Rage.Native;
using Rage.Attributes;
using LSPD_First_Response.Mod.API;
using LSPD_First_Response.Mod.Callouts;
using LSPD_First_Response.Engine.Scripting;
using LSPD_First_Response.Engine;
using System.Drawing;
using System.Windows.Forms;
using LSPD_First_Response.Engine.Scripting.Entities;

namespace CALLOUTPACKNAME.Callouts
{
    [CalloutInfo("CalloutName", CalloutProbability.VeryLow)]
    public class CalloutNameSpace : Callout
    {
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Vector3 AreaBlip;
        private Vector3 SearchAreaLocation;
        private Vector3 Route;
        private Vector3 SpawnPoint0;
        private Vector3 SpawnPoint1;
        private Vector3 SpawnPoint2;
        private Vector3 SpawnPoint3;
        private Vector3 SpawnPoint4;
        private Vector3 SpawnPoint5;
        private Vector3 SpawnPoint6;
        private Vector3 SpawnPoint7;
        private Vector3 SpawnPoint8;
        private Vector3 SpawnPoint9;
        private Vector3 SpawnPoint10;
        private Vector3 SpawnPoint11;
        private Vector3 SpawnPoint12;
        private Vector3 SpawnPoint13;
        private Vector3 SpawnPoint14;
        private Vector3 SpawnPoint15;
        private Blip SearchAreaBlip;
        private Blip Waypoint;
        private Blip SuspectBlip;

        public override bool OnBeforeCalloutDisplayed()
        {

            AreaBlip = new Vector3(-427.577f, 1116.049f, 326.783f);
            Route = new Vector3(-427.577f, 1116.049f, 326.783f);
            SearchAreaLocation = new Vector3(-427.577f, 1116.049f, 326.783f);
            SpawnPoint0 = new Vector3(-427.577f, 1116.049f, 326.783f);
            SpawnPoint1 = new Vector3(-397.247f, 1127.590f, 322.724f);
            SpawnPoint2 = new Vector3(-428.174f, 1122.083f, 325.854f);
            SpawnPoint3 = new Vector3(454.413f, -740.819f, 27.358f);
            SpawnPoint4 = new Vector3(459.643f, -759.451f, 27.358f);
            SpawnPoint5 = new Vector3(452.857f, -779.992f, 27.358f);
            SpawnPoint6 = new Vector3(460.017f, -809.125f, 27.322f);
            SpawnPoint7 = new Vector3(478.739f, -700.984f, 32.051f);
            SpawnPoint8 = new Vector3(480.516f, -747.916f, 37.396f);
            SpawnPoint9 = new Vector3(476.067f, -804.597f, 42.672f);
            SpawnPoint10 = new Vector3(466.171f, -779.360f, 32.459f);
            SpawnPoint11 = new Vector3(430.765f, -711.007f, 35.727f);
            SpawnPoint12 = new Vector3(449.468f, -725.472f, 35.987f);
            SpawnPoint13 = new Vector3(447.883f, -755.353f, 38.004f);
            SpawnPoint14 = new Vector3(449.329f, -780.423f, 44.531f);
            SpawnPoint15 = new Vector3(433.665f, -806.423f, 38.013f);
            ShowCalloutAreaBlipBeforeAccepting(AreaBlip, 50f); AddMinimumDistanceCheck(40f, AreaBlip);
            CalloutMessage = "Callout Name"; CalloutPosition = AreaBlip;
          
            return base.OnBeforeCalloutDisplayed();
        }


        public override bool OnCalloutAccepted()
        {
            Functions.PlayScannerAudio("RESPOND_CODE_3");

            myPed = new Ped("a_m_m_og_boss_01", SpawnPoint0, 0f);
            myPed.IsPersistent = true;
            myPed.BlockPermanentEvents = true;

            Suspect = new Ped("a_m_m_og_boss_01", SpawnPoint1, 0f);
            Suspect.IsPersistent = true;
            Suspect.BlockPermanentEvents = true;

            Waypoint = new Blip(Route);
            Waypoint.Color = (Color.Yellow);
            Waypoint.EnableRoute(Color.Yellow);

            return base.OnCalloutAccepted();
        }

        public override void Process()
        {
            base.Process();

                if (Game.LocalPlayer.Character.DistanceTo(Suspect.Position) < 5f)
                {
                    SuspectBlip = Suspect.AttachBlip();
                    SuspectBlip.IsFriendly = false;
                    SuspectBlip.Scale = 0.75f;
                }

                if (Game.LocalPlayer.Character.DistanceTo(myPed.Position) < 80f)
                {
                    SearchAreaBlip = new Blip(SearchAreaLocation, 80f);
                    SearchAreaBlip.Color = Color.Yellow;
                    SearchAreaBlip.Alpha = 0.5f;
                }

                if (Game.LocalPlayer.Character.DistanceTo(myPed.Position) < 80f)
                {
                    Waypoint.Delete();
                    Waypoint.DisableRoute();
                }

        }

        public override void End()
        {
            base.End();
        }
    }
}

maybe now u know what is bad.

Edited by WildJam
Link to comment
Share on other sites

7 hours ago, WildJam said:

i posted, nobody reply to me. 

 

and, i understand it like that, i can make only codes respecting only one ped, beacuse when i make other code respecting other ped, then its does not works.

and when i delete earlier code, then other works. im making callout with searching area.

 

my code:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Rage;
using Rage.Native;
using Rage.Attributes;
using LSPD_First_Response.Mod.API;
using LSPD_First_Response.Mod.Callouts;
using LSPD_First_Response.Engine.Scripting;
using LSPD_First_Response.Engine;
using System.Drawing;
using System.Windows.Forms;
using LSPD_First_Response.Engine.Scripting.Entities;

namespace CALLOUTPACKNAME.Callouts
{
    [CalloutInfo("CalloutName", CalloutProbability.VeryLow)]
    public class CalloutNameSpace : Callout
    {
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Ped myPed;
        private Vector3 AreaBlip;
        private Vector3 SearchAreaLocation;
        private Vector3 Route;
        private Vector3 SpawnPoint0;
        private Vector3 SpawnPoint1;
        private Vector3 SpawnPoint2;
        private Vector3 SpawnPoint3;
        private Vector3 SpawnPoint4;
        private Vector3 SpawnPoint5;
        private Vector3 SpawnPoint6;
        private Vector3 SpawnPoint7;
        private Vector3 SpawnPoint8;
        private Vector3 SpawnPoint9;
        private Vector3 SpawnPoint10;
        private Vector3 SpawnPoint11;
        private Vector3 SpawnPoint12;
        private Vector3 SpawnPoint13;
        private Vector3 SpawnPoint14;
        private Vector3 SpawnPoint15;
        private Blip SearchAreaBlip;
        private Blip Waypoint;
        private Blip SuspectBlip;

        public override bool OnBeforeCalloutDisplayed()
        {

            AreaBlip = new Vector3(-427.577f, 1116.049f, 326.783f);
            Route = new Vector3(-427.577f, 1116.049f, 326.783f);
            SearchAreaLocation = new Vector3(-427.577f, 1116.049f, 326.783f);
            SpawnPoint0 = new Vector3(-427.577f, 1116.049f, 326.783f);
            SpawnPoint1 = new Vector3(-397.247f, 1127.590f, 322.724f);
            SpawnPoint2 = new Vector3(-428.174f, 1122.083f, 325.854f);
            SpawnPoint3 = new Vector3(454.413f, -740.819f, 27.358f);
            SpawnPoint4 = new Vector3(459.643f, -759.451f, 27.358f);
            SpawnPoint5 = new Vector3(452.857f, -779.992f, 27.358f);
            SpawnPoint6 = new Vector3(460.017f, -809.125f, 27.322f);
            SpawnPoint7 = new Vector3(478.739f, -700.984f, 32.051f);
            SpawnPoint8 = new Vector3(480.516f, -747.916f, 37.396f);
            SpawnPoint9 = new Vector3(476.067f, -804.597f, 42.672f);
            SpawnPoint10 = new Vector3(466.171f, -779.360f, 32.459f);
            SpawnPoint11 = new Vector3(430.765f, -711.007f, 35.727f);
            SpawnPoint12 = new Vector3(449.468f, -725.472f, 35.987f);
            SpawnPoint13 = new Vector3(447.883f, -755.353f, 38.004f);
            SpawnPoint14 = new Vector3(449.329f, -780.423f, 44.531f);
            SpawnPoint15 = new Vector3(433.665f, -806.423f, 38.013f);
            ShowCalloutAreaBlipBeforeAccepting(AreaBlip, 50f); AddMinimumDistanceCheck(40f, AreaBlip);
            CalloutMessage = "Callout Name"; CalloutPosition = AreaBlip;
          
            return base.OnBeforeCalloutDisplayed();
        }


        public override bool OnCalloutAccepted()
        {
            Functions.PlayScannerAudio("RESPOND_CODE_3");

            myPed = new Ped("a_m_m_og_boss_01", SpawnPoint0, 0f);
            myPed.IsPersistent = true;
            myPed.BlockPermanentEvents = true;

            Suspect = new Ped("a_m_m_og_boss_01", SpawnPoint1, 0f);
            Suspect.IsPersistent = true;
            Suspect.BlockPermanentEvents = true;

            Waypoint = new Blip(Route);
            Waypoint.Color = (Color.Yellow);
            Waypoint.EnableRoute(Color.Yellow);

            return base.OnCalloutAccepted();
        }

        public override void Process()
        {
            base.Process();

                if (Game.LocalPlayer.Character.DistanceTo(Suspect.Position) < 5f)
                {
                    SuspectBlip = Suspect.AttachBlip();
                    SuspectBlip.IsFriendly = false;
                    SuspectBlip.Scale = 0.75f;
                }

                if (Game.LocalPlayer.Character.DistanceTo(myPed.Position) < 80f)
                {
                    SearchAreaBlip = new Blip(SearchAreaLocation, 80f);
                    SearchAreaBlip.Color = Color.Yellow;
                    SearchAreaBlip.Alpha = 0.5f;
                }

                if (Game.LocalPlayer.Character.DistanceTo(myPed.Position) < 80f)
                {
                    Waypoint.Delete();
                    Waypoint.DisableRoute();
                }

        }

        public override void End()
        {
            base.End();
        }
    }
}

maybe now u know what is bad.

when the blips delete do the peds walk away, if yes you need to press f4 and check if the callout ended

🇨🇦🇳🇱🇺🇦 Слава Україні! 🇺🇦🇳🇱🇨🇦

🇨🇦🇳🇱🇺🇦 Героям слава! 🇺🇦🇳🇱🇨🇦

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.




×
×
  • Create New...