diff --git a/ReallifeGamemode.Client/admin/aspeed.ts b/ReallifeGamemode.Client/admin/aspeed.ts index 880762c5..4d0c919f 100644 --- a/ReallifeGamemode.Client/admin/aspeed.ts +++ b/ReallifeGamemode.Client/admin/aspeed.ts @@ -7,15 +7,12 @@ export default function () { mp.events.addDataHandler("vehicleAdminSpeed", (entity, newValue) => { if (!entity.isAVehicle()) return; entity.setEnginePowerMultiplier(newValue); - mp.gui.chat.push("Debug0"); }); mp.events.addDataHandler("vehicleAdminSpeed2", (entity, newValue2) => { if (!entity.isAVehicle()) return; - mp.gui.chat.push("Debug1"); //entity.setEngineTorqueMultiplier(newValue2); TorqueEntity = entity; TorqueValue = newValue2; - mp.gui.chat.push("Debug2"); }); /*mp.events.add('render', () => { let vehicle = mp.players.local.vehicle; diff --git a/ReallifeGamemode.Client/index.ts b/ReallifeGamemode.Client/index.ts index b958cd1e..66159d5b 100644 --- a/ReallifeGamemode.Client/index.ts +++ b/ReallifeGamemode.Client/index.ts @@ -176,6 +176,9 @@ vehicleDoor(); import freeze from './util/freeze'; freeze(); +import ped from './util/ped'; +ped(); + import reportList from './Player/reportmenu'; reportList(globalData); diff --git a/ReallifeGamemode.Client/util/freeze.ts b/ReallifeGamemode.Client/util/freeze.ts index b4f57d13..4b654bfb 100644 --- a/ReallifeGamemode.Client/util/freeze.ts +++ b/ReallifeGamemode.Client/util/freeze.ts @@ -28,344 +28,5 @@ player.vehicle.freezePosition(false); player.freezePosition(false); }); - var ped - mp.events.add("CLIENT:AddPed", (model, positionx, positiony, positionz, heading, dimension) => { - if (model < 1) { - return; - } - if (model == 1) { - ped = mp.peds.new( - mp.game.joaat('a_c_chickenhawk'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 2) { - ped = mp.peds.new( - mp.game.joaat('a_c_boar'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 3) { - ped = mp.peds.new( - mp.game.joaat('cs_bradcadaver'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 4) { - ped = mp.peds.new( - mp.game.joaat('a_c_cat_01'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 5) { - ped = mp.peds.new( - mp.game.joaat('a_c_chimp'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 6) { - ped = mp.peds.new( - mp.game.joaat('a_c_chop'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 7) { - ped = mp.peds.new( - mp.game.joaat('a_c_cormorant'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 8) { - ped = mp.peds.new( - mp.game.joaat('a_c_cow'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 9) { - ped = mp.peds.new( - mp.game.joaat('a_c_coyote'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 10) { - ped = mp.peds.new( - mp.game.joaat('a_c_crow'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 11) { - ped = mp.peds.new( - mp.game.joaat('a_c_deer'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 12) { - ped = mp.peds.new( - mp.game.joaat('a_c_dolphin'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 13) { - ped = mp.peds.new( - mp.game.joaat('a_c_fish'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 14) { - ped = mp.peds.new( - mp.game.joaat('a_c_sharkhammer'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 15) { - ped = mp.peds.new( - mp.game.joaat('a_c_humpback'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 16) { - ped = mp.peds.new( - mp.game.joaat('a_c_husky'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 17) { - ped = mp.peds.new( - mp.game.joaat('ig_johnnyklebitz'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 18) { - ped = mp.peds.new( - mp.game.joaat('a_c_killerwhale'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 19) { - ped = mp.peds.new( - mp.game.joaat('mp_m_marston_01'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 20) { - ped = mp.peds.new( - mp.game.joaat('a_c_mtlion'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 21) { - ped = mp.peds.new( - mp.game.joaat('s_m_m_movalien_01'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 22) { - ped = mp.peds.new( - mp.game.joaat('mp_m_niko_01'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 23) { - ped = mp.peds.new( - mp.game.joaat('a_c_pig'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 24) { - ped = mp.peds.new( - mp.game.joaat('a_c_pigeon'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 25) { - ped = mp.peds.new( - mp.game.joaat('a_c_poodle'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 26) { - ped = mp.peds.new( - mp.game.joaat('a_c_pug'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 27) { - ped = mp.peds.new( - mp.game.joaat('a_c_rabbit_01'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 28) { - ped = mp.peds.new( - mp.game.joaat('a_c_rat'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 29) { - ped = mp.peds.new( - mp.game.joaat('a_c_retriever'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 30) { - ped = mp.peds.new( - mp.game.joaat('a_c_rhesus'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 31) { - ped = mp.peds.new( - mp.game.joaat('a_c_rottweiler'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 32) { - ped = mp.peds.new( - mp.game.joaat('a_c_seagull'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 33) { - ped = mp.peds.new( - mp.game.joaat('a_c_shepherd'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 34) { - ped = mp.peds.new( - mp.game.joaat('a_c_stingray'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 35) { - ped = mp.peds.new( - mp.game.joaat('a_c_sharktiger'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 36) { - ped = mp.peds.new( - mp.game.joaat('a_c_westy'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 37) { - ped = mp.peds.new( - mp.game.joaat('ig_barry'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 38) { - ped = mp.peds.new( - mp.game.joaat('cs_barry'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - if (model == 39) { - ped = mp.peds.new( - mp.game.joaat('ig_bankman'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - /*let dynamicPed = mp.peds.new(mp.game.joaat('mp_m_freemode_01'), mp.players.at(0).position, { dynamic: true }); - dynamicPed.controller = mp.players.at(0); - - let staticPed = mp.peds.new(mp.game.joaat('player_zero'), mp.players.at(0).position, - { - dynamic: false, // still server-side but not sync'ed anymore - frozen: true, - invincible: true - });*/ - if (model == 40) { - ped = mp.peds.new( - mp.game.joaat('cs_bankman'), - new mp.Vector3(positionx, positiony, positionz), - heading, - dimension - ); - } - //ped.setAlpha(255); - ped.freezePosition(false); - ped.setInvincible(false); - ped.setProofs(false, false, false, false, false, false, false, false); - }); } diff --git a/ReallifeGamemode.Client/util/ped.ts b/ReallifeGamemode.Client/util/ped.ts new file mode 100644 index 00000000..03d70184 --- /dev/null +++ b/ReallifeGamemode.Client/util/ped.ts @@ -0,0 +1,389 @@ +export default function ped() { + var ped + var AddPed + mp.events.add("CLIENT:AddPed", (PedNr, model, positionx, positiony, positionz, heading, dimension, dynamic, freeze, collision, weapon, attackproof, fireexplosionproof, drownproof) => { + PedNr = mp.peds.new( + mp.game.joaat(`${model}`), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + PedNr.setDynamic(dynamic); + PedNr.freezePosition(freeze); + if (collision == 0) { + PedNr.setCollision(true, true); + PedNr.setProofs(attackproof, fireexplosionproof, fireexplosionproof, true, attackproof, false, false, drownproof) + } + if (collision == 1) { + PedNr.setCollision(false, true); + PedNr.setProofs(attackproof, fireexplosionproof, fireexplosionproof, false, attackproof, false, false, drownproof) + } + if (collision == 2) { + PedNr.setCollision(true, false); + PedNr.setProofs(attackproof, fireexplosionproof, fireexplosionproof, true, attackproof, false, false, drownproof) + } + if (collision == 3) { + PedNr.setCollision(false, false); + PedNr.setProofs(attackproof, fireexplosionproof, fireexplosionproof, false, attackproof, false, false, drownproof) + } + PedNr.setCanBeDamaged(attackproof); + PedNr.setInvincible(attackproof); + //mp.gui.chat.push(`SetInvincible(${attackproof};`); + //mp.gui.chat.push(`SetProofs(${attackproof}, ${fireexplosionproof}, ${attackproof}, ${drownproof});`); + + //let pedweapon = mp.game.weapon.createWeaponObject(mp.game.joaat(`${weapon}`), 9999, 0.0, 0.0, 0.0, false, 0.0, 0.0) + //mp.game.weapon.giveWeaponObjectToPed(pedweapon, AddPed); + mp.game.invoke("0xBF0FD6E56C964FCB", PedNr.handle, mp.game.joaat("weapon_SpecialCarbine"), 100, 0, 1); + }); + mp.events.add("CLIENT:DestroyPed", (PedNr) => { + PedNr.destroy(); + }); + mp.events.add("CLIENT:AddPedModel", (model, positionx, positiony, positionz, heading, dimension) => { + if (model < 1) { + return; + } + if (model == 1) { + ped = mp.peds.new( + mp.game.joaat('a_c_chickenhawk'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 2) { + ped = mp.peds.new( + mp.game.joaat('a_c_boar'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 3) { + ped = mp.peds.new( + mp.game.joaat('cs_bradcadaver'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 4) { + ped = mp.peds.new( + mp.game.joaat('a_c_cat_01'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 5) { + ped = mp.peds.new( + mp.game.joaat('a_c_chimp'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 6) { + ped = mp.peds.new( + mp.game.joaat('a_c_chop'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 7) { + ped = mp.peds.new( + mp.game.joaat('a_c_cormorant'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 8) { + ped = mp.peds.new( + mp.game.joaat('a_c_cow'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 9) { + ped = mp.peds.new( + mp.game.joaat('a_c_coyote'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 10) { + ped = mp.peds.new( + mp.game.joaat('a_c_crow'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 11) { + ped = mp.peds.new( + mp.game.joaat('a_c_deer'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 12) { + ped = mp.peds.new( + mp.game.joaat('a_c_dolphin'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 13) { + ped = mp.peds.new( + mp.game.joaat('a_c_fish'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 14) { + ped = mp.peds.new( + mp.game.joaat('a_c_sharkhammer'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 15) { + ped = mp.peds.new( + mp.game.joaat('a_c_humpback'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 16) { + ped = mp.peds.new( + mp.game.joaat('a_c_husky'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 17) { + ped = mp.peds.new( + mp.game.joaat('ig_johnnyklebitz'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 18) { + ped = mp.peds.new( + mp.game.joaat('a_c_killerwhale'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 19) { + ped = mp.peds.new( + mp.game.joaat('mp_m_marston_01'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 20) { + ped = mp.peds.new( + mp.game.joaat('a_c_mtlion'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 21) { + ped = mp.peds.new( + mp.game.joaat('s_m_m_movalien_01'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 22) { + ped = mp.peds.new( + mp.game.joaat('mp_m_niko_01'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 23) { + ped = mp.peds.new( + mp.game.joaat('a_c_pig'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 24) { + ped = mp.peds.new( + mp.game.joaat('a_c_pigeon'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 25) { + ped = mp.peds.new( + mp.game.joaat('a_c_poodle'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 26) { + ped = mp.peds.new( + mp.game.joaat('a_c_pug'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 27) { + ped = mp.peds.new( + mp.game.joaat('a_c_rabbit_01'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 28) { + ped = mp.peds.new( + mp.game.joaat('a_c_rat'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 29) { + ped = mp.peds.new( + mp.game.joaat('a_c_retriever'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 30) { + ped = mp.peds.new( + mp.game.joaat('a_c_rhesus'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 31) { + ped = mp.peds.new( + mp.game.joaat('a_c_rottweiler'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 32) { + ped = mp.peds.new( + mp.game.joaat('a_c_seagull'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 33) { + ped = mp.peds.new( + mp.game.joaat('a_c_shepherd'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 34) { + ped = mp.peds.new( + mp.game.joaat('a_c_stingray'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 35) { + ped = mp.peds.new( + mp.game.joaat('a_c_sharktiger'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 36) { + ped = mp.peds.new( + mp.game.joaat('a_c_westy'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 37) { + ped = mp.peds.new( + mp.game.joaat('ig_barry'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 38) { + ped = mp.peds.new( + mp.game.joaat('cs_barry'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + if (model == 39) { + ped = mp.peds.new( + mp.game.joaat('ig_bankman'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + /*let dynamicPed = mp.peds.new(mp.game.joaat('mp_m_freemode_01'), mp.players.at(0).position, { dynamic: true }); + dynamicPed.controller = mp.players.at(0); + + let staticPed = mp.peds.new(mp.game.joaat('player_zero'), mp.players.at(0).position, + { + dynamic: false, // still server-side but not sync'ed anymore + frozen: true, + invincible: true + });*/ + if (model == 40) { + var ped44 = mp.peds.new( + mp.game.joaat('cs_bankman'), + new mp.Vector3(positionx, positiony, positionz), + heading, + dimension + ); + } + ped.freezePosition(false); + ped.setInvincible(false); + ped.setProofs(false, false, false, false, false, false, false, false); + ped.setVisible(true, true); + //ped.applyForceTo(5, positionx + 5, positiony + 5, positionz, 0.0, 0.0, 0.0, 1, true, true, true, true, true); + ped.processAttachments(); + ped.setAlwaysPrerender(true); + ped.setAsMission(true, true); + ped.setCanBeTargetedWithoutLos(true); + ped.setIsTargetPriority(true, true); + ped.setMotionBlur(true); + ped.setRenderScorched(true); + //ped.setAlpha(100); + mp.game.invoke("0xBF0FD6E56C964FCB", ped.handle, mp.game.joaat("weapon_SpecialCarbine"), 100, false, true); + }); +} \ No newline at end of file diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 31182709..ae7e5180 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -851,15 +851,37 @@ namespace ReallifeGamemode.Server.Commands } } - [Command("addpped", "~m~Benutzung: ~s~/addpped [model] [dimension]")] - public void CmdAdminAddPPed(Player player, int model, uint dimension = 0) + [Command("destroyped", "~m~Benutzung: ~s~/destroyped [PedNr]")] + public void CmdAdminAddPPed(Player player, int PedNr) { if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true) { ChatService.NotAuthorized(player); return; } - player.TriggerEvent("CLIENT:AddPed", model, player.Position.X, player.Position.Y, player.Position.Z, player.Heading, dimension); + player.TriggerEvent("CLIENT:DestroyPed", PedNr); + //NAPI.Ped.CreatePed(PedHash.Bankman, new Vector3(player.Position.X, player.Position.Y, player.Position.Z), player.Heading, dimension); + } + [Command("addpped", "~m~Benutzung: ~s~/addpped [PedNr] [model] [dimension] [Dynamic] [Freezed] [Collision(0-3)] [Weapon] [AttackProof] [Fire/Explosion-Proof] [DrownProof]")] + public void CmdAdminAddPPed(Player player, Array PedNr, string model, uint dimension = 0, bool dynamic = false, bool freeze = false, int collision = 0, string weapon = "none", bool attackproof = false, bool fireexplosionproof = false, bool drownproof = false) + { + if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true) + { + ChatService.NotAuthorized(player); + return; + } + player.TriggerEvent("CLIENT:AddPed", PedNr, model, player.Position.X, player.Position.Y, player.Position.Z, player.Heading, dimension, dynamic, freeze, collision, weapon, attackproof, fireexplosionproof, drownproof); + //NAPI.Ped.CreatePed(PedHash.Bankman, new Vector3(player.Position.X, player.Position.Y, player.Position.Z), player.Heading, dimension); + } + [Command("addmped", "~m~Benutzung: ~s~/addmped [model] [dimension]")] + public void CmdAdminAddMPed(Player player, int model, uint dimension = 0) + { + if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true) + { + ChatService.NotAuthorized(player); + return; + } + player.TriggerEvent("CLIENT:AddPedModel", model, player.Position.X, player.Position.Y, player.Position.Z, player.Heading, dimension); //NAPI.Ped.CreatePed(PedHash.Bankman, new Vector3(player.Position.X, player.Position.Y, player.Position.Z), player.Heading, dimension); } [Command("addgped", "~m~Benutzung: ~s~/addgped")] diff --git a/ReallifeGamemode.Server/Events/Disconnect.cs b/ReallifeGamemode.Server/Events/Disconnect.cs index 63bb4232..e5a8c9e9 100644 --- a/ReallifeGamemode.Server/Events/Disconnect.cs +++ b/ReallifeGamemode.Server/Events/Disconnect.cs @@ -99,6 +99,10 @@ namespace ReallifeGamemode.Server.Events user.Dead = player.HasData("isDead") ? (bool)player.GetData("isDead") : false; } player.SetData("isLoggedIn", false); + player.TriggerEvent("CLIENT:DestroyPed", 1); + player.TriggerEvent("CLIENT:DestroyPed", 2); + player.TriggerEvent("CLIENT:DestroyPed", 3); + player.TriggerEvent("CLIENT:DestroyPed", 4); } } } diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index 7d1ab498..24bc7eed 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -615,6 +615,7 @@ namespace ReallifeGamemode.Server.Events { player.SetData("HatRoute", true); c.StartBusRoute(player, "RouteStart"); + player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/StartJob", "wav", 45); } } if ((VehicleHash)jV.Model == VehicleHash.Coach && !state) @@ -625,6 +626,7 @@ namespace ReallifeGamemode.Server.Events { player.SetData("HatRoute", true); c.StartBusRoute(player, "RouteStart"); + player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/StartJob", "wav", 45); } } else @@ -641,6 +643,7 @@ namespace ReallifeGamemode.Server.Events { player.SetData("HatRoute", true); c.StartBusRoute(player, "RouteStart"); + player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/StartJob", "wav", 45); } } else diff --git a/ReallifeGamemode.Server/Events/Login.cs b/ReallifeGamemode.Server/Events/Login.cs index 936a89ee..7a886750 100644 --- a/ReallifeGamemode.Server/Events/Login.cs +++ b/ReallifeGamemode.Server/Events/Login.cs @@ -156,6 +156,10 @@ namespace ReallifeGamemode.Server.Events { player.SetData("isDead", false); } + player.TriggerEvent("CLIENT:AddPed", 1, "a_m_y_acult_01", 484.5094909667969, -2174.849853515625, 5.918272495269775, -29.673072814941406, 0, false, true, 0, "none", true, true, true);//Ped_Müllmann + player.TriggerEvent("CLIENT:AddPed", 2, "a_m_y_acult_01", 1706.76953125, 3277.220947265625, 41.1555061340332, -159.447998046875, 0, false, true, 0, "none", true, true, true);//Ped_Pilot Sandyshores + player.TriggerEvent("CLIENT:AddPed", 3, "a_m_y_acult_01", -1621.4542236328125, -3152.724365234375, 13.991769790649414, 50.73009490966797, 0, false, true, 0, "none", true, true, true);//Ped_Pilot LS Airport + player.TriggerEvent("CLIENT:AddPed", 4, "a_m_y_acult_01", -534.4425659179688, -2145.747314453125, 5.992100715637207, 53.96156692504883, 0, false, true, 0, "none", true, true, true);//Ped Busfahrer } } } diff --git a/ReallifeGamemode.Server/Job/BusDriverJob.cs b/ReallifeGamemode.Server/Job/BusDriverJob.cs index d816b7bc..3c16ebd0 100644 --- a/ReallifeGamemode.Server/Job/BusDriverJob.cs +++ b/ReallifeGamemode.Server/Job/BusDriverJob.cs @@ -19,63 +19,107 @@ namespace ReallifeGamemode.Server.Job public override bool NeedVehicleToStart => false; - private readonly IReadOnlyCollection Route1 = new List - { - new Vector3(-105.5951, -1684.548, 28.23948), - new Vector3(-1056.246, -2552.576, 12.66063), - new Vector3(200.3088, -1978.828, 18.3329), - new Vector3(358.6138, -1785.821, 27.92113), - new Vector3(281.8594, -1462.503, 28.13148), - new Vector3(77.72239, -1212.086, 28.12294), - new Vector3(218.1398, -850.9549, 29.16619) - }.AsReadOnly(); - - private readonly IReadOnlyCollection Route2 = new List + private readonly IReadOnlyCollection Skill1Route1 = new List//Bus_Skill_1_Route_1 { - new Vector3(403.4488, -786.5514, 28.2046), - new Vector3(787.6898, -1364.566, 25.41318), - new Vector3(942.0541, -1447.974, 30.14204), - new Vector3(866.8322, -997.5225, 29.48207), - new Vector3(785.4254, -781.3905, 25.33277), - new Vector3(351.5793, -1064.582, 28.40059), - new Vector3(235.0964, -857.1152, 28.74256), + new Vector3(-1018.1577758789062, -2732.403564453125, 13.658967971801758), + new Vector3(-153.04013061523438, -2033.8385009765625, 22.712543487548828), + new Vector3(50.42457580566406, -1536.9090576171875, 29.184476852416992), + new Vector3(361.1451721191406, -1064.6044921875, 29.36113166809082), + new Vector3(119.01465606689453, -785.609619140625, 31.267763137817383), + new Vector3(-172.00689697265625, -815.9910888671875, 31.13607406616211), + new Vector3(-707.7088623046875, -826.9969482421875, 23.451000213623047), + new Vector3(-658.1038818359375, -1393.321533203125, 10.509778022766113), + new Vector3(-1018.1826171875, -2732.371826171875, 13.656649589538574), + new Vector3(-647.2696533203125, -2215.64501953125, 5.989798069000244), }.AsReadOnly(); - private readonly IReadOnlyCollection Route3 = new List + private readonly IReadOnlyCollection Skill1Route2 = new List//Bus_Skill_1_Route_2 { - new Vector3(313.7626,-647.1252,27.6658), - new Vector3(28.84793,-543.386,34.42649), - new Vector3(120.2759,-195.0664,52.98029), - new Vector3(291.5339,-257.244,52.89333), - new Vector3(459.6921,116.3203,97.18157), - new Vector3(173.9451,220.1987,104.4178), - new Vector3(-327.3175,261.2248,84.86708), - new Vector3(-764.2745,294.4415,84.00808), - new Vector3(-980.486,275.0842,67.26749), - new Vector3(-1031.586,107.9002,51.30307), - new Vector3(-489.973,-195.4356,35.59651), - new Vector3(-312.2727,-367.7886,28.93641), - new Vector3(-224.4042,-528.0254,33.08064), - new Vector3(-245.7707,-714.5482,31.90899), - new Vector3(-248.9475,-883.7717,29.00919), + new Vector3(-567.6445922851562, -1233.4453125, 15.050300598144531), + new Vector3(-509.224609375, -668.373291015625, 33.02402877807617), + new Vector3(55.00559997558594, -749.8328247070312, 44.11421203613281), + new Vector3(-173.65509033203125, -152.5533905029297, 43.615516662597656), + new Vector3(-523.8310546875, -266.884033203125, 35.291507720947266), + new Vector3(-1167.646728515625, -400.75, 35.39745330810547), + new Vector3(-1408.329345703125, -567.8721923828125, 30.22767448425293), + new Vector3(-1213.3565673828125, -1214.755859375, 7.5853986740112305), + new Vector3(-746.8554077148438, -2372.227783203125, 14.740862846374512), + new Vector3(-660.7366333007812, -2206.03662109375, 5.988998889923096), }.AsReadOnly(); - private readonly IReadOnlyCollection Route4 = new List + private readonly IReadOnlyCollection Skill1Route3 = new List//Bus_Skill_1_Route_3 + { + new Vector3(423.4793395996094, -2143.4169921875, 18.23659896850586), + new Vector3(875.1618041992188, -1766.7913818359375, 29.780052185058594), + new Vector3(1166.110107421875, -1422.72265625, 34.477935791015625), + new Vector3(807.715087890625, -1356.7987060546875, 26.29298210144043), + new Vector3(785.9387817382812, -780.5958251953125, 26.333005905151367), + new Vector3(895.2793579101562, 55.24346923828125, 78.82550048828125), + new Vector3(775.8052368164062, 596.2352905273438, 125.77734375), + new Vector3(307.64422607421875, -762.0469360351562, 29.197702407836914), + new Vector3(-105.66091918945312, -1683.9630126953125, 29.190542221069336), + new Vector3(-644.0516967773438, -2218.673828125, 5.991928577423096), + }.AsReadOnly(); + + private readonly IReadOnlyCollection Skill1Route4 = new List//Bus_Skill_1_Route_4 { - new Vector3(403.8605,-597.0284,27.1788), - new Vector3(953.7955,140.8976,79.34214), - new Vector3(1531.374,832.1884,75.94727), - new Vector3(1972.424,2643.501,44.62299), - new Vector3(1812.351,3318.685,40.64569), - new Vector3(1820.982,3700.176,32.31515), - new Vector3(2599.954,4264.15,40.87192), - new Vector3(2705.722,3308.447,54.2841), - new Vector3(355.8403,-634.835,27.56906), + new Vector3(-694.1781616210938, -1199.3873291015625, 10.50633716583252), + new Vector3(-1408.264892578125, -567.5278930664062, 30.21875), + new Vector3(-1681.6112060546875, -503.3702392578125, 37.79117965698242), + new Vector3(-1427.05712890625, -90.17198181152344, 52.015113830566406), + new Vector3(-686.4015502929688, -374.3297424316406, 34.17094802856445), + new Vector3(-509.60107421875, -668.41796875, 33.02873229980469), + new Vector3(234.6927032470703, -857.5449829101562, 29.747934341430664), + new Vector3(787.8258666992188, -1364.9345703125, 26.424083709716797), + new Vector3(825.1477661132812, -1634.5733642578125, 30.521774291992188), + new Vector3(-105.38816833496094, -1683.646728515625, 29.19083023071289), + new Vector3(-655.6530151367188, -2209.579345703125, 5.98785924911499), + }.AsReadOnly(); - }.AsReadOnly(); + private readonly IReadOnlyCollection Skill2Route1 = new List//Bus_Skill_2_Route_1 + { - private readonly IReadOnlyCollection Route5 = new List + new Vector3(-1042.6405029296875, -2718.244384765625, 14.493847846984863), + new Vector3(832.205322265625, -11.559977531433105, 79.72754669189453), + new Vector3(2563.96826171875, 2633.976806640625, 37.279945373535156), + new Vector3(1684.845947265625, 6402.1533203125, 30.877294540405273), + new Vector3(-170.82965087890625, 6374.9560546875, 30.695466995239258), + new Vector3(-1524.5302734375, 4998.1220703125, 62.54846954345703), + new Vector3(-3234.168701171875, 974.0481567382812, 12.890801429748535), + new Vector3(-1331.8995361328125, -1052.2794189453125, 7.4408793449401855), + }.AsReadOnly(); + private readonly IReadOnlyCollection Skill2Route2 = new List//Bus_Skill_2_Route_2 + { + + new Vector3(-562.68, -2203.85, 5.5), + }.AsReadOnly(); + private readonly IReadOnlyCollection Skill2Route3 = new List//Bus_Skill_2_Route_3 + { + + new Vector3(-562.68, -2203.85, 5.5), + }.AsReadOnly(); + private readonly IReadOnlyCollection Skill2Route4 = new List//Bus_Skill_2_Route_4 + { + + new Vector3(-562.68, -2203.85, 5.5), + }.AsReadOnly(); + private readonly IReadOnlyCollection Skill3Route1 = new List//Bus_Skill_3_Route_1 + { + + new Vector3(-562.68, -2203.85, 5.5), + }.AsReadOnly(); + private readonly IReadOnlyCollection Skill3Route2 = new List//Bus_Skill_3_Route_2 + { + + new Vector3(-562.68, -2203.85, 5.5), + }.AsReadOnly(); + private readonly IReadOnlyCollection Skill3Route3 = new List//Bus_Skill_3_Route_3 + { + + new Vector3(-562.68, -2203.85, 5.5), + }.AsReadOnly(); + private readonly IReadOnlyCollection Skill3Route4 = new List//Bus_Skill_3_Route_4 { new Vector3(-562.68, -2203.85, 5.5), @@ -168,25 +212,36 @@ namespace ReallifeGamemode.Server.Job { if (type == "RouteStart") { - player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/StartJob", "wav", 45); if ((VehicleHash)veh.Model == VehicleHash.Bus) { Random rnd = new Random(); - int rroute = rnd.Next(1, 3); + int rroute = rnd.Next(1, 5); switch (rroute) { case 1: { - CheckPointHandle.StartCheckPointRoute(player, Route1, 4000, 1, 7, 3, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill1Route1, 4000, 1, 7, 3, true, "busDriverJob"); player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 1"); break; } case 2: { - CheckPointHandle.StartCheckPointRoute(player, Route2, 4000, 1, 7, 3, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill1Route2, 4000, 1, 7, 3, true, "busDriverJob"); player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 2"); break; } + case 3: + { + CheckPointHandle.StartCheckPointRoute(player, Skill1Route3, 4000, 1, 7, 3, true, "busDriverJob"); + player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 3"); + break; + } + case 4: + { + CheckPointHandle.StartCheckPointRoute(player, Skill1Route4, 4000, 1, 7, 3, true, "busDriverJob"); + player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 4"); + break; + } } player.TriggerEvent("CLIENT:SetDoorOpen", 0, false, false); player.TriggerEvent("CLIENT:SetDoorOpen", 1, false, false); @@ -200,18 +255,30 @@ namespace ReallifeGamemode.Server.Job if ((VehicleHash)veh.Model == VehicleHash.Coach) { Random rnd = new Random(); - int rroute = rnd.Next(1, 3); + int rroute = rnd.Next(1, 5); switch (rroute) { case 1: { - CheckPointHandle.StartCheckPointRoute(player, Route3, 4000, 1, 7, 3, true, "busDriverJob"); - player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 3"); + CheckPointHandle.StartCheckPointRoute(player, Skill2Route1, 4000, 1, 7, 3, true, "busDriverJob"); + player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 1"); break; } case 2: { - CheckPointHandle.StartCheckPointRoute(player, Route4, 4000, 1, 7, 3, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill2Route2, 4000, 1, 7, 3, true, "busDriverJob"); + player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 2"); + break; + } + case 3: + { + CheckPointHandle.StartCheckPointRoute(player, Skill2Route3, 4000, 1, 7, 3, true, "busDriverJob"); + player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 3"); + break; + } + case 4: + { + CheckPointHandle.StartCheckPointRoute(player, Skill2Route4, 4000, 1, 7, 3, true, "busDriverJob"); player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 4"); break; } @@ -221,34 +288,89 @@ namespace ReallifeGamemode.Server.Job } if ((VehicleHash)veh.Model == VehicleHash.Tourbus) { - CheckPointHandle.StartCheckPointRoute(player, Route5, 4000, 1, 7, 3, true, "busDriverJob"); - player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 5"); + Random rnd = new Random(); + int rroute = rnd.Next(1, 5); + switch (rroute) + { + case 1: + { + CheckPointHandle.StartCheckPointRoute(player, Skill3Route1, 4000, 1, 7, 3, true, "busDriverJob"); + player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 1"); + break; + } + case 2: + { + CheckPointHandle.StartCheckPointRoute(player, Skill3Route2, 4000, 1, 7, 3, true, "busDriverJob"); + player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 2"); + break; + } + case 3: + { + CheckPointHandle.StartCheckPointRoute(player, Skill3Route3, 4000, 1, 7, 3, true, "busDriverJob"); + player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 3"); + break; + } + case 4: + { + CheckPointHandle.StartCheckPointRoute(player, Skill3Route4, 4000, 1, 7, 3, true, "busDriverJob"); + player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 4"); + break; + } + } player.TriggerEvent("CLIENT:SetDoorOpen", 2, false, false); player.TriggerEvent("CLIENT:SetDoorOpen", 3, false, false); player.TriggerEvent("CLIENT:SetDoorShut", 2, false); player.TriggerEvent("CLIENT:SetDoorShut", 3, false); } } - if (type == "Route1") + /*if (type == "Skill1Route1") { - CheckPointHandle.StartCheckPointRoute(player, Route1, 4000, 1, 7, 4, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill1Route1, 4000, 1, 7, 4, true, "busDriverJob"); } - else if (type == "Route2") + if (type == "Skill1Route2") { - CheckPointHandle.StartCheckPointRoute(player, Route2, 4000, 1, 7, 4, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill1Route2, 4000, 1, 7, 4, true, "busDriverJob"); } - else if (type == "Route3") + if (type == "Skill1Route3") { - CheckPointHandle.StartCheckPointRoute(player, Route3, 4000, 1, 7, 4, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill1Route3, 4000, 1, 7, 4, true, "busDriverJob"); } - else if (type == "Route4") + if (type == "Skill1Route4") { - CheckPointHandle.StartCheckPointRoute(player, Route4, 4000, 1, 7, 4, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill1Route4, 4000, 1, 7, 4, true, "busDriverJob"); } - else if (type == "Route5") + if (type == "Skill2Route1") { - CheckPointHandle.StartCheckPointRoute(player, Route5, 4000, 1, 7, 4, true, "busDriverJob"); + CheckPointHandle.StartCheckPointRoute(player, Skill2Route1, 4000, 1, 7, 4, true, "busDriverJob"); } + if (type == "Skill2Route2") + { + CheckPointHandle.StartCheckPointRoute(player, Skill2Route2, 4000, 1, 7, 4, true, "busDriverJob"); + } + if (type == "Skill2Route3") + { + CheckPointHandle.StartCheckPointRoute(player, Skill2Route3, 4000, 1, 7, 4, true, "busDriverJob"); + } + if (type == "Skill2Route4") + { + CheckPointHandle.StartCheckPointRoute(player, Skill2Route4, 4000, 1, 7, 4, true, "busDriverJob"); + } + if (type == "Skill3Route1") + { + CheckPointHandle.StartCheckPointRoute(player, Skill3Route1, 4000, 1, 7, 4, true, "busDriverJob"); + } + if (type == "Skill3Route2") + { + CheckPointHandle.StartCheckPointRoute(player, Skill3Route2, 4000, 1, 7, 4, true, "busDriverJob"); + } + if (type == "Skill3Route3") + { + CheckPointHandle.StartCheckPointRoute(player, Skill3Route3, 4000, 1, 7, 4, true, "busDriverJob"); + } + if (type == "Skill3Route4") + { + CheckPointHandle.StartCheckPointRoute(player, Skill3Route4, 4000, 1, 7, 4, true, "busDriverJob"); + }*/ //player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/StartJob", "wav", 50); } } @@ -291,76 +413,111 @@ namespace ReallifeGamemode.Server.Job { BusDriverJob c = new BusDriverJob(); Vehicle v = player.Vehicle; - if (v.Model == (uint)Types.VehicleModel.Bus) + player.SendChatMessage("~y~[JOB] ~w~Die neue Route Lädt. Bitte Warten..."); + NAPI.Task.Run(() => { - Random rnd = new Random(); - int rroute = rnd.Next(1, 3); - switch (rroute) + player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/FahrplanAbfahrt", "wav", 15); + c.StartBusRoute(player, "RouteStart"); + /*if (v.Model == (uint)Types.VehicleModel.Bus) { - case 1: + player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/FahrplanAbfahrt", "wav", 15); + Random rnd = new Random(); + int rroute = rnd.Next(1, 5); + switch (rroute) { - player.SendChatMessage("~y~[JOB] ~w~Die neue Route Lädt. Bitte Warten..."); - NAPI.Task.Run(() => + case 1: { - player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/FahrplanAbfahrt", "wav", 15); - c.StartBusRoute(player, "Route1"); - player.SendChatMessage("~y~[JOB] ~w~Eine neue Route wurde gesetzt.: ~g~Route 1"); - }, delayTime: 30000); - break; - } - case 2: - { - player.SendChatMessage("~y~[JOB] ~w~Die neue Route Lädt. Bitte Warten..."); - NAPI.Task.Run(() => + c.StartBusRoute(player, "Skill1Route1"); + player.SendChatMessage("~y~[JOB] ~w~Eine neue Route wurde gesetzt.: ~g~Route 1"); + break; + } + case 2: { - player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/FahrplanAbfahrt", "wav", 15); - c.StartBusRoute(player, "Route2"); - player.SendChatMessage("~y~[JOB] ~w~Eine neue Route wurde gesetzt.: ~g~Route 2"); - }, delayTime: 30000); - break; - } - } - } - if (v.Model == (uint)Types.VehicleModel.Coach) - { - Random rnd = new Random(); - int rroute = rnd.Next(1, 3); - switch (rroute) - { - case 1: - { - player.SendChatMessage("~y~[JOB] ~w~Die neue Route Lädt. Bitte Warten..."); - NAPI.Task.Run(() => - { - player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/FahrplanAbfahrt", "wav", 15); - c.StartBusRoute(player, "Route3"); + c.StartBusRoute(player, "Skill1Route2"); + player.SendChatMessage("~y~[JOB] ~w~Eine neue Route wurde gesetzt.: ~g~Route 2"); + break; + } + case 3: + { + c.StartBusRoute(player, "Skill1Route3"); player.SendChatMessage("~y~[JOB] ~w~Eine neue Route wurde gesetzt.: ~g~Route 3"); - }, delayTime: 30000); - break; - } - case 2: - { - player.SendChatMessage("~y~[JOB] ~w~Die neue Route Lädt. Bitte Warten..."); - NAPI.Task.Run(() => - { - player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/FahrplanAbfahrt", "wav", 15); - c.StartBusRoute(player, "Route4"); + break; + } + case 4: + { + c.StartBusRoute(player, "Skill1Route4"); player.SendChatMessage("~y~[JOB] ~w~Eine neue Route wurde gesetzt.: ~g~Route 4"); - }, delayTime: 30000); - break; - } + break; + } + } } - } - if (v.Model == (uint)Types.VehicleModel.Tourbus) - { - player.SendChatMessage("~y~[JOB] ~w~Die neue Route Lädt. Bitte Warten..."); - NAPI.Task.Run(() => - { - player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/FahrplanAbfahrt", "wav", 15); - c.StartBusRoute(player, "Route5"); - player.SendChatMessage("~y~[JOB] ~w~Eine neue Route wurde gesetzt.: ~g~Route 5"); - }, delayTime: 30000); - } + if (v.Model == (uint)Types.VehicleModel.Coach) + { + player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/FahrplanAbfahrt", "wav", 15); + Random rnd = new Random(); + int rroute = rnd.Next(1, 5); + switch (rroute) + { + case 1: + { + c.StartBusRoute(player, "Skill2Route1"); + player.SendChatMessage("~y~[JOB] ~w~Eine neue Route wurde gesetzt.: ~g~Route 1"); + break; + } + case 2: + { + c.StartBusRoute(player, "Skill2Route2"); + player.SendChatMessage("~y~[JOB] ~w~Eine neue Route wurde gesetzt.: ~g~Route 2"); + break; + } + case 3: + { + c.StartBusRoute(player, "Skill2Route3"); + player.SendChatMessage("~y~[JOB] ~w~Eine neue Route wurde gesetzt.: ~g~Route 3"); + break; + } + case 4: + { + c.StartBusRoute(player, "Skill2Route4"); + player.SendChatMessage("~y~[JOB] ~w~Eine neue Route wurde gesetzt.: ~g~Route 4"); + break; + } + } + } + if (v.Model == (uint)Types.VehicleModel.Tourbus) + { + player.TriggerEvent("CLIENT:PlaySound", "jobs/busfahrer/FahrplanAbfahrt", "wav", 15); + Random rnd = new Random(); + int rroute = rnd.Next(1, 5); + switch (rroute) + { + case 1: + { + c.StartBusRoute(player, "Skill3Route1"); + player.SendChatMessage("~y~[JOB] ~w~Eine neue Route wurde gesetzt.: ~g~Route 1"); + break; + } + case 2: + { + c.StartBusRoute(player, "Skill3Route2"); + player.SendChatMessage("~y~[JOB] ~w~Eine neue Route wurde gesetzt.: ~g~Route 2"); + break; + } + case 3: + { + c.StartBusRoute(player, "Skill3Route3"); + player.SendChatMessage("~y~[JOB] ~w~Eine neue Route wurde gesetzt.: ~g~Route 3"); + break; + } + case 4: + { + c.StartBusRoute(player, "Skill3Route4"); + player.SendChatMessage("~y~[JOB] ~w~Eine neue Route wurde gesetzt.: ~g~Route 4"); + break; + } + } + }*/ + }, delayTime: 30000); } } } diff --git a/ReallifeGamemode.Server/Job/PilotJob.cs b/ReallifeGamemode.Server/Job/PilotJob.cs index 6e57b849..0f554670 100644 --- a/ReallifeGamemode.Server/Job/PilotJob.cs +++ b/ReallifeGamemode.Server/Job/PilotJob.cs @@ -18,92 +18,76 @@ namespace ReallifeGamemode.Server.Job public override bool NeedVehicleToStart => false; - private readonly IReadOnlyCollection Route1 = new List - { - new Vector3(-322.61, 2613.05, 327.87), - new Vector3(-81.03, 3685.12, 337.44), - new Vector3(964.75, 4304.75, 322.26), - new Vector3(1865.4, 4786.56, 265.71), - new Vector3(2228.51, 5999.19, 264.56), - new Vector3(1603.63, 6452.82, 224.97), - new Vector3(515.21, 6555.43, 289.65), - new Vector3( 9.61, 6409.95, 301.73), - new Vector3(-558.94, 5571.06, 352.2), - new Vector3(-1029.6, 4943.04, 398.4), - new Vector3(-1030.29, 4446.83, 392.74), - new Vector3(-219.31, 3689.86, 380.81), - new Vector3(212.74, 3061.88, 395.36), - }.AsReadOnly(); - - private readonly IReadOnlyCollection Route2 = new List - { - new Vector3(2760.91, 3606.83, 459.27), - new Vector3(2663.72, 2532.03, 502.4), - new Vector3(2513.93, 1096.15, 507.45), - new Vector3(2532.33, 75.23, 491.21), - new Vector3(2627.95, -1030.54, 395.27), - new Vector3(1672.97, -1743.65, 421.86), - new Vector3(637.9, -2011.36, 386.82), - new Vector3(208.09, -1629.12, 322.08), - new Vector3(-258.94, -930.23, 342.11), - new Vector3(-610.22, 157.79, 350.23), - new Vector3(-1275.95, 342.97, 326.71), - }.AsReadOnly(); - - private readonly IReadOnlyCollection Route3 = new List - { - new Vector3(-850.61, 2181.98, 429.67), - new Vector3(-675.89, 1709.52, 462.85), - new Vector3(-1295.41, 1184.66, 489.47), - new Vector3(-2452.89, 1760.76, 466.53), - new Vector3(-2607.08, 2981.38, 454.81), - new Vector3(-1771.7, 4241.02, 460.07), - new Vector3(1158.77, 4573.67, 455.08), - new Vector3(2028.63, 4842.29, 437.01), - }.AsReadOnly(); - - private readonly IReadOnlyCollection Route4 = new List - { - new Vector3(893.99, -3091.43, 326.67), - new Vector3(1712.6, -1676.47, 384.2), - new Vector3(2501.18, -446.15, 339.48), - new Vector3(2706.43, 1408.93, 251.08), - new Vector3(3568.08, 3644.51, 326.06), - new Vector3(314.92, 2877.15, 173.73), - new Vector3(-2044.89, 3141.58, 378.07), - new Vector3(-2333.96, 510.26, 660.64), - }.AsReadOnly(); - - private readonly IReadOnlyCollection Route5 = new List + private readonly IReadOnlyCollection Skill1Route1 = new List//Pilot_Skill_1_Route_1 { - new Vector3(-485.68, -2776.08, 204.5), - new Vector3(-19.83, -2133.08, 296.04), - new Vector3(593.51, -1221.58, 358.93), - new Vector3(1053.45, -216.29, 419.24), - new Vector3(321.3, 455.51, 441.46), - new Vector3(-391.02, 746.88, 482.8), - new Vector3(-1191.09, 497.77, 493.4), - new Vector3(-1427.7, -152.65, 529.69), - new Vector3(-933.83, -820.37, 550.32), - new Vector3(-58.74, -1264.74, 567.36), - new Vector3(1050.73, -1345.57, 511.35), + new Vector3(1645.9910888671875, 3236.744873046875, 40.98052978515625), + new Vector3(302.6805114746094, 2867.93896484375, 204.81182861328125), + new Vector3(-1093.6722412109375, 2737.1376953125, 257.575439453125), + new Vector3(-2286.014892578125, 3019.12841796875, 33.4510498046875), + new Vector3(-2471.854248046875, 3271.08935546875, 33.47834777832031), + new Vector3(-623.9515380859375, 5313.12158203125, 181.6047821044922), + new Vector3(1896.899658203125, 4824.203125, 208.77737426757812), + new Vector3(2281.790283203125, 3606.98681640625, 132.3915252685547), + new Vector3(1610.4461669921875, 3225.36376953125, 41.05073928833008), }.AsReadOnly(); - private readonly IReadOnlyCollection Route6 = new List + private readonly IReadOnlyCollection Skill1Route2 = new List//Pilot_Skill_1_Route_2 + { + new Vector3(1593.927490234375, 3193.30908203125, 41.170997619628906), + new Vector3(961.5843505859375, 2278.5966796875, 251.17218017578125), + new Vector3(924.3920288085938, 93.95357513427734, 282.3033142089844), + new Vector3(963.6002197265625, -3101.551513671875, 177.8121337890625), + new Vector3(-1265.1163330078125, -2990.142578125, 14.595105171203613), + new Vector3(-1260.78662109375, -2806.293212890625, 14.587812423706055), + new Vector3(-894.3707885742188, 82.7993392944336, 385.011962890625), + new Vector3(919.4126586914062, 2553.385986328125, 135.39154052734375), + new Vector3(1592.840087890625, 3192.8017578125, 41.169837951660156), + }.AsReadOnly(); + + private readonly IReadOnlyCollection Skill1Route3 = new List//Pilot_Skill_1_Route_3 + { + new Vector3(-850.61, 2181.98, 429.67), + }.AsReadOnly(); + + private readonly IReadOnlyCollection Skill2Route1 = new List//Pilot_Skill_2_Route_1 + { + new Vector3(-1563.0125732421875, -3019.960205078125, 14.879448890686035), + new Vector3(-606.9600830078125, -2660.677490234375, 136.10226440429688), + new Vector3(734.489990234375, -967.21533203125, 604.9561157226562), + new Vector3(107.65938568115234, 1202.3692626953125, 972.5994873046875), + new Vector3(67.48933410644531, 3056.564697265625, 865.25537109375), + new Vector3(1707.2711181640625, 3276.216064453125, 41.155494689941406), + new Vector3(1731.6995849609375, 3308.203125, 41.223514556884766), + new Vector3(1106.1397705078125, 3090.18798828125, 74.03556823730469), + new Vector3(41.88761901855469, 1728.1295166015625, 446.2645568847656), + new Vector3(-1144.333984375, -943.0862426757812, 376.0502624511719), + new Vector3(-1406.51220703125, -2334.29052734375, 50.125667572021484), + new Vector3(-1590.4517822265625, -2996.38330078125, 13.94474983215332), + new Vector3(-1666.028076171875, -3082.910888671875, 13.944761276245117), + }.AsReadOnly(); + + private readonly IReadOnlyCollection Skill2Route2 = new List//Pilot_Skill_2_Route_2 + { + new Vector3(-1412.8221435546875, -3044.2587890625, 14.887921333312988), + new Vector3(-1627.982177734375, -2714.71875, 14.880501747131348), + new Vector3(-1309.5150146484375, -2030.012451171875, 120.04487609863281), + new Vector3(-1079.538330078125, -325.4757385253906, 435.19158935546875), + new Vector3(-495.6157531738281, 2248.668701171875, 800.2356567382812), + new Vector3(1707.2711181640625, 3276.216064453125, 41.155494689941406), + new Vector3(1850.8380126953125, 4677.72412109375, 71.57810974121094), + new Vector3(2131.758544921875, 4782.18115234375, 40.970279693603516), + new Vector3(1963.30078125, 4726.73681640625, 52.904056549072266), + new Vector3(1168.9517822265625, 4205.9033203125, 172.29588317871094), + new Vector3(-1138.7547607421875, -1896.85498046875, 91.5819091796875), + new Vector3(-1551.466064453125, -2706.53125, 13.945389747619629), + new Vector3(-1571.1328125, -2856.3505859375, 13.944441795349121), + new Vector3(-1582.531005859375, -2999.940185546875, 13.936454772949219), + new Vector3(-1668.747802734375, -3081.548095703125, 13.9447660446167), + }.AsReadOnly(); + + private readonly IReadOnlyCollection Skill2Route3 = new List//Pilot_Skill_2_Route_3 { new Vector3(-710.89, -1836.81, 355.46), - new Vector3(-1401.58, -1168.05, 370.7), - new Vector3(-1725.31, -88.63, 373.11), - new Vector3(-1638.16, 693.35, 390.45), - new Vector3(-750.7, 827.2, 409.28), - new Vector3(5.21, 272.84, 386.02), - new Vector3(549.75, 79.87, 383.02), - new Vector3(969.91, -197.75, 350.65), - new Vector3( 864.8, -761.71, 346.14), - new Vector3(501.07, -1252.33, 348.55), - new Vector3(253.06, -1777.1, 319.34), - new Vector3(-160.39, -2088.53, 312.12), - new Vector3(-591.96, -1943.26, 311.73), }.AsReadOnly(); @@ -184,19 +168,19 @@ namespace ReallifeGamemode.Server.Job { case 1: { - CheckPointHandle.StartCheckPointRoute(player, Route1, 0, 6, 40, 10, true, "pilotJob"); //6, 23, 25, 26, 27, 28 + CheckPointHandle.StartCheckPointRoute(player, Skill1Route1, 0, 6, 40, 10, true, "pilotJob"); //6, 23, 25, 26, 27, 28 player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 1"); break; } case 2: { - CheckPointHandle.StartCheckPointRoute(player, Route2, 0, 6, 40, 10, true, "pilotJob"); //6, 23, 25, 26, 27, 28 + CheckPointHandle.StartCheckPointRoute(player, Skill1Route2, 0, 6, 40, 10, true, "pilotJob"); //6, 23, 25, 26, 27, 28 player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 2"); break; } case 3: { - CheckPointHandle.StartCheckPointRoute(player, Route3, 0, 6, 40, 10, true, "pilotJob"); //6, 23, 25, 26, 27, 28 + CheckPointHandle.StartCheckPointRoute(player, Skill1Route3, 0, 6, 40, 10, true, "pilotJob"); //6, 23, 25, 26, 27, 28 player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 3"); break; } @@ -210,26 +194,26 @@ namespace ReallifeGamemode.Server.Job { case 1: { - CheckPointHandle.StartCheckPointRoute(player, Route4, 0, 6, 40, 10, true, "pilotJob"); //6, 23, 25, 26, 27, 28 - player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 4"); + CheckPointHandle.StartCheckPointRoute(player, Skill2Route1, 0, 6, 40, 10, true, "pilotJob"); //6, 23, 25, 26, 27, 28 + player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 1"); break; } case 2: { - CheckPointHandle.StartCheckPointRoute(player, Route5, 0, 6, 40, 10, true, "pilotJob"); //6, 23, 25, 26, 27, 28 - player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 5"); + CheckPointHandle.StartCheckPointRoute(player, Skill2Route2, 0, 6, 40, 10, true, "pilotJob"); //6, 23, 25, 26, 27, 28 + player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 2"); break; } case 3: { - CheckPointHandle.StartCheckPointRoute(player, Route6, 0, 6, 40, 10, true, "pilotJob"); //6, 23, 25, 26, 27, 28 - player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 6"); + CheckPointHandle.StartCheckPointRoute(player, Skill2Route3, 0, 6, 40, 10, true, "pilotJob"); //6, 23, 25, 26, 27, 28 + player.SendChatMessage("~y~[JOB] ~w~Route wurde gesetzt.: ~g~Route 3"); break; } } } } - if (type == "Route 1") + /*if (type == "Route 1") { CheckPointHandle.StartCheckPointRoute(player, Route1, 0, 6, 40, 10, true, "pilotJob"); //6, 23, 25, 26, 27, 28 } @@ -252,7 +236,7 @@ namespace ReallifeGamemode.Server.Job else if (type == "Route 6") { CheckPointHandle.StartCheckPointRoute(player, Route6, 0, 6, 40, 10, true, "pilotJob"); - } + }*/ } } public static void payWage(Player jobber, int wage) @@ -285,7 +269,8 @@ namespace ReallifeGamemode.Server.Job { PilotJob c = new PilotJob(); Vehicle v = player.Vehicle; - if (player.HasData("PilotenBase") && player.GetData("PilotenBase") == 1) + c.StartPilotRoute(player, "RouteStart"); + /*if (player.HasData("PilotenBase") && player.GetData("PilotenBase") == 1) { Random rnd = new Random(); int rroute = rnd.Next(1, 4); @@ -336,7 +321,7 @@ namespace ReallifeGamemode.Server.Job break; } } - } + }*/ } } }