Server crashes on CreateOwnedExplosion

Recommended Posts

Hey there,

I am fairly new to but neverless a fairly experienced C# developer.


Well I am using the PlaceMine example from gtanetwork. Already rewrote the page to fit NAPI instead of API.


Still my server.exe crashes once the mine is supposed to explode. No error logs :/ It just stops running, any ideas ?


using System;
using GTANetworkAPI;

namespace minesTest
    public class minesTest:Script

        public minesTest()

        public void myResourceStart()
            NAPI.Util.ConsoleOutput("TestScript started!");

        public void PlaceMine(Client sender)
            var pos = NAPI.Entity.GetEntityPosition(sender);
            var playerDimension = NAPI.Entity.GetEntityDimension(sender);

            var prop = NAPI.Object.CreateObject(NAPI.Util.GetHashKey("prop_bomb_01"), pos - new Vector3(0, 0, 1f), new Vector3(), 255, playerDimension);
            var shape = NAPI.ColShape.CreateSphereColShape(pos, 10);
            shape.Dimension = playerDimension;

            bool mineArmed = false;

            shape.OnEntityEnterColShape += (s, ent) =>
                if (!mineArmed) return;

                NAPI.Explosion.CreateOwnedExplosion(sender, ExplosionType.ProxMine, pos, 1f, playerDimension);

            shape.OnEntityExitColShape += (s, ent) =>
                if(ent == sender.Handle && !mineArmed)
                    mineArmed = true;
                    NAPI.Notification.SendNotificationToPlayer(sender, "Mine has been ~r~armed~w~!", true);



Share this post

Link to post
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.

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.

  • Recently Browsing   0 members

    No registered users viewing this page.