示例#1
0
        public override void onMount(GameBase obj, SceneObject mountObj, int node)
        {
            Player      player           = obj.getId();
            VehicleData vehicleDataBlock = mountObj.getDataBlock();

            if (node == 0)
            {
                player.setTransform(new TransformF("0 0 0 0 0 1 0"));
                string mountPose = vehicleDataBlock["mountPose[" + node + "]"];
                player.setActionThread(mountPose, true, true);
                player["lastWeapon"] = player.getMountedImage(Constants.WeaponSlot).AsString();
                GameConnection client = player["client"];
                if (client.isObject())
                {
                    player["lastperson"] = client.isFirstPerson().AsString();
                }
                player.unmountImage(Constants.WeaponSlot);
                player.setControlObject(mountObj);
                if (player.getClassName() == "Player")
                {
                    console.commandToClient(player["client"], console.addTaggedString("toggleVehicleMapToggle"),
                                            new[] { "true" });
                }
            }
            else
            {
                string pose = vehicleDataBlock["mountPose[" + node + "]"];
                player.setActionThread(pose != string.Empty ? pose : "root", false, true);
            }
        }