Grandpa Rex 27 Posted January 8 Share Posted January 8 It isn't pretty but it works. Ignore all the locations that is because I made this a county based callout Important note: Make sure to leave InitBlip() under Task OnAccept() The idea behind this, knowing that onesync essentially divides the server into little mini servers based on the location of players I figured that the old method of making callouts by having the PED's spawn OnAccept would just then have OneSync despawn them. Well we have the OnStart as well, so I figured why not have the PED's spawn when the player gets close enough for the callout to start? I have not tested how far out this works, this is a limit but I'm not sure Literally had the idea threw it into my callout then tested it and wanted to get the information out there for the more experienced Developers to run with! using System; using System.Collections.Generic; using System.Threading.Tasks; using CitizenFX.Core; using FivePD.API; using FivePD.API.Utils; namespace FivePD_Callouts { [CalloutProperties(name: "Domestic Disusturbance", author: "Fastlane Studios", version: "1.0")] public class domesticdisturbance : Callout { private readonly Random rnd = new Random(); private Ped suspect, victim; public domesticdisturbance() { Random random = new Random(); int x = random.Next(1, 100 + 1); if (x <= 9) { InitInfo(new Vector3(1418.92f, 3675.69f, 33.99f)); } else if (x >= 10 && x <= 19) { InitInfo(new Vector3(1711.01f, 4678.28f, 42.97f)); } else if (x >= 20 && x <= 29) { InitInfo(new Vector3(2382.88f, 3308.13f, 47.62f)); } else if (x >= 30 && x <= 39) { InitInfo(new Vector3(471.07f, 2614.76f, 43.34f)); } else if (x >= 40 && x <= 49) { InitInfo(new Vector3(1933.02f, 3883.36f, 32.41f)); } else if (x >= 50 && x <= 59) { InitInfo(new Vector3(-3218.89f, 1102.99f, 10.44f)); } else if (x >= 60 && x <= 69) { InitInfo(new Vector3(3321.2f, 5173.45f, 18.42f)); } else if (x >= 70 && x <= 79) { InitInfo(new Vector3(2712.91f, 4147.31f, 43.81f)); } else if (x >= 80 && x <= 89) { InitInfo(new Vector3(783.81f, 2191.13f, 51.92f)); } else if (x >= 90) { InitInfo(new Vector3(53.23f, 3707.98f, 39.75f)); } ShortName = "Domestic Disturbance"; CalloutDescription = "Reports of a domestic disturbance, suspect may be armed"; ResponseCode = 3; StartDistance = 50f; } public override async Task OnAccept() { InitBlip(); UpdateData(); } public async override void OnStart(Ped player) { base.OnStart(player); suspect = await SpawnPed(RandomUtils.GetRandomPed(), Location); victim = await SpawnPed(RandomUtils.GetRandomPed(), Location); suspect.AlwaysKeepTask = true; victim.AlwaysKeepTask = true; suspect.BlockPermanentEvents = true; victim.BlockPermanentEvents = true; suspect.Weapons.Give(getRandomWeapon(), 1, true, true); suspect.Task.FightAgainst(victim); victim.Task.ReactAndFlee(suspect); suspect.AttachBlip(); victim.AttachBlip(); } private WeaponHash getRandomWeapon() { List<WeaponHash> weapons = new List<WeaponHash> { WeaponHash.Bat, WeaponHash.Bottle, WeaponHash.Crowbar, WeaponHash.Hammer, WeaponHash.Knife, WeaponHash.Unarmed }; return weapons[rnd.Next(weapons.Count)]; } } } 5 Quote Link to post Share on other sites
Grimace 0 Posted January 9 Share Posted January 9 This seems to be generic enough that maybe it could be put directly into the FivePD files instead of each callout as well Quote Link to post Share on other sites
Grandpa Rex 27 Posted January 9 Author Share Posted January 9 6 hours ago, Grimace said: This seems to be generic enough that maybe it could be put directly into the FivePD files instead of each callout as well That would require an entire rework of how FivePD works. This post was designed for the Callout Developers in the community to update their callouts Quote Link to post Share on other sites
Management Team NorthCam18 310 Posted January 9 Management Team Share Posted January 9 This content has been moved to the correct section by the Management Team. Next time please post in the correct section. If you feel this was a mistake, please report this reply with a valid reason. 1 Quote NorthCam18 OPERATIONS DIRECTOR GitHub Account | northcam@gtapolicemods.com Link to post Share on other sites
BGHDDevelopment 268 Posted January 16 Share Posted January 16 Great info! Quote YouTube | Callouts | Twitter Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.