public void ArmorOnUnmount(coPlayerData datablock, coPlayer player, coVehicle vehicle, int node) { if (node != 0) return; player.mountImage(player["lastWeapon"], WeaponSlot, true, ""); player.setControlObject(""); if (!player["lastperson"].AsBool()) return; coGameConnection client = player["client"]; if (client.isObject()) client.setFirstPerson(player["lastperson"].AsBool()); }
public void ServerCmdcarUnmountObj(coGameConnection client, coPlayer obj) { obj.unmount(); obj.setControlObject(obj); TransformF ejectpos = obj.getTransform(); ejectpos += new TransformF(0, 0, 5); obj.setTransform(ejectpos); coVehicle mvehicle = obj["mVehicle"]; Point3F ejectvel = mvehicle.getVelocity(); ejectvel += new Point3F(0, 0, 10); ejectvel = ejectvel.vectorScale(((coSimDataBlock) (obj.getDataBlock()))["mass"].AsFloat()); obj.applyImpulse(ejectpos.MPosition, ejectvel); }
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); } }