Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //totally 100% untested
- //i'm pretty sure everything will work, but i am skeptical about GetClosestFirePosition
- class Fire
- {
- private int g_FireID;
- public int FireID
- {
- get
- {
- return g_FireID;
- }
- }
- public Fire(int fireID)
- {
- g_FireID = fireID;
- }
- public Fire(GTA.Math.Vector3 position, int maxChildren, bool isGasFire)
- {
- g_FireID = GTA.Native.Function.Call<int>(GTA.Native.Hash.START_SCRIPT_FIRE, position.X, position.Y, position.Z, maxChildren, isGasFire);
- }
- public static Fire CreateFire(GTA.Math.Vector3 position, int maxChildren, bool isGasFire)
- {
- return new Fire(position, maxChildren, isGasFire);
- }
- public void Remove()
- {
- RemoveFire(g_FireID);
- }
- public static void RemoveFire(int fireID)
- {
- GTA.Native.Function.Call<int>(GTA.Native.Hash.REMOVE_SCRIPT_FIRE, fireID);
- }
- public static int GetNumberOfFiresInRange(GTA.Math.Vector3 position, float radius)
- {
- return GTA.Native.Function.Call<int>(GTA.Native.Hash.GET_NUMBER_OF_FIRES_IN_RANGE, position.X, position.Y, position.Z, radius);
- }
- public static void StopFireInRange(GTA.Math.Vector3 position, float radius)
- {
- GTA.Native.Function.Call(GTA.Native.Hash.STOP_FIRE_IN_RANGE, position.X, position.Y, position.Z, radius);
- }
- public static bool GetClosestFirePosition(out Fire fire, out GTA.Math.Vector3 position)
- {
- GTA.Native.OutputArgument fireID = new GTA.Native.OutputArgument();
- GTA.Native.OutputArgument x = new GTA.Native.OutputArgument(), y = new GTA.Native.OutputArgument(), z = new GTA.Native.OutputArgument();
- bool foundOne;
- foundOne = GTA.Native.Function.Call<bool>(GTA.Native.Hash.GET_CLOSEST_FIRE_POS, fireID, x, y, z);
- fire = new Fire(fireID.GetResult<int>());
- position = new GTA.Math.Vector3(x.GetResult<float>(), y.GetResult<float>(), z.GetResult<float>());
- return foundOne;
- }
- }
Add Comment
Please, Sign In to add comment