Пример #1
0
        public void PlayerPlayDeathAnimation(coPlayer player)
            {
            int numDeathAnimations = player.getNumDeathAnimations();
            if (numDeathAnimations <= 0)
                return;

            coGameConnection client = player["client"];
            if (client.isObject())
                {
                int deathidx = client["deathIdx"].AsInt();
                if ((deathidx > numDeathAnimations) || (deathidx == 0))
                    {
                    deathidx = 1;
                    }
                player.setActionThread("Death" + deathidx, false, true);
                deathidx++;
                client["deathIdx"] = deathidx.AsString();
                }
            else
                {
                int r = new Random().Next(1, numDeathAnimations);
                player.setActionThread("Death" + r, false, true);
                }
            }
Пример #2
0
 public void PlayerPlayCelAnimation(coPlayer player, string anim)
     {
     if (player.getState() != "Dead")
         player.setActionThread(string.Format("cel{0}", anim), false, true);
     }
Пример #3
0
        public void ArmorOnMount(coPlayerData datablock, coPlayer player, coVehicle vehicle, int node)
            {
            coVehicleData vehicleDataBlock = vehicle.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(WeaponSlot).AsString();


                coGameConnection client = player["client"];
                if (client.isObject())
                    player["lastperson"] = client.isFirstPerson().AsString();

                player.unmountImage(WeaponSlot);


                player.setControlObject(vehicle);

                if (player.getClassName() == "Player")
                    {
                    console.commandToClient(player["client"], console.addTaggedString("toggleVehicleMap"), new[] { "true" });
                    }
                }
            else
                {
                string pose = vehicleDataBlock["mountPose[" + node + "]"];
                player.setActionThread(pose != "" ? pose : "root", false, true);
                }
            }