Jump to content
×
×
  • Create New...

StartScriptFire


Nylander
 Share

Reason for Locking
Inactivity

By Benzaboy, on 10/26/20 02:24 PM.

Recommended Posts

Hi!

 

I'm sitting and trying to make a fire callout, but I ran into a problem ? 

I tried to call 

StartScriptFire(offsetX, offsetY, 0, 25, true);

Which should start a fire, but it didn't.

 

Does anyone know why it doesn't work? ? 

 

My code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CitizenFX.Core;
using static CitizenFX.Core.Native.API;
using CalloutAPI;

namespace NylanderCallouts
{
    [CalloutProperties("Benzinbrand", "Nylander", "0.0.1", Probability.Medium)]
    public class GasolineFire : CalloutAPI.Callout
    {
        public GasolineFire()
        {
            Random rnd = new Random();
            float offsetX = rnd.Next(100, 700);
            float offsetY = rnd.Next(100, 700);

            InitBase(Game.PlayerPed.GetOffsetPosition(new Vector3(offsetX, offsetY, 0)));

            ShortName = "Benzinbrand";
            CalloutDescription = "Der er brand i noget benzin!";
            ResponseCode = 2;
            StartDistance = 120f;
        }

        public async override Task Init()
        {
            OnAccept();

            Random rnd = new Random();
            float offsetX = rnd.Next(100, 700);
            float offsetY = rnd.Next(100, 700);

            StartScriptFire(offsetX, offsetY, 0, 25, true);
        }

        public override void OnStart(Ped player)
        {
            base.OnStart(player);
        }
    }
}

 

Link to post
Share on other sites

  • 2 weeks later...
StartScriptFire(offsetX, offsetY, 0, 25, true);

That wont work, as you're setting the position to 0. The fire would spawn, but not at ground height.

 

World.GetGroundHeight();

Consider using this method

  • Like 2
Link to post
Share on other sites

  • 4 months later...
Guest
This topic is now closed to further replies.
 Share

  • 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.