コード例 #1
0
        public override void onDisabled(ShapeBase obj, string lastState)
        {
            Player player = obj.getId();

            player.setImageTrigger(0, false);
            GameBaseData item = (((GameBaseData)(player.getMountedImage(Constants.WeaponSlot)))["item"]);

            if (item.isObject())
            {
                int amount = player.getInventory(item["image.ammo"]);

                if (amount.AsBool())
                {
                    player.Throw(item["image.clip"], 1);
                }
            }
            player.tossPatch();
            player.playDeathCry();
            player.playDeathAnimation();

            //If it's a player check.....
            GameConnection client = player["client"];

            if (client.isObject())
            {
                //todo Remove the console.commandToClient since the default one now shows in the Util class.
                console.commandToClient(client, console.addTaggedString("toggleVehicleMapToggle"), new[] { "false" });
            }
            //Util._commandToClient(client, "toggleVehicleMap", false.AsString());

            int ctov = iGlobal["$CorpseTimeoutValue"];

            player.schedule((ctov - 1000).AsString(), "startFade", "1000", "0", "true");
            player.schedule(ctov.AsString(), "delete");
        }