public void VehicleDataOnRemove(coVehicleData thisobj, coVehicle obj) { // if there are passengers/driver, kick them out for (int i = 0; i < ((coVehicleData) obj.getDataBlock())["numMountPoints"].AsInt(); i++) { coPlayer passenger = obj.getMountNodeObject(i); if (passenger != "0") passenger.call("doDismount", true.AsString()); } }
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); } }