From ef824fb63c2d6b09eaf16ad645edd5f49aff8903 Mon Sep 17 00:00:00 2001 From: ghermans Date: Thu, 24 Jan 2019 02:40:14 +0100 Subject: [PATCH 1/4] Fixed some small issues --- vf_mtest/__resource.lua | 4 ++- vf_mtest/missions/cl_dispatch.lua | 6 ++++ vf_mtest/missions/cl_ruinermadness.lua | 44 ++++++++++++++++++++++---- vf_mtest/missions/cl_securityvan.lua | 3 +- vf_mtest/missions/cl_snitch.lua | 6 +++- vf_mtest/sv_missionsapp.lua | 5 +++ 6 files changed, 58 insertions(+), 10 deletions(-) create mode 100644 vf_mtest/sv_missionsapp.lua diff --git a/vf_mtest/__resource.lua b/vf_mtest/__resource.lua index 46b2d92..ce6b1fb 100644 --- a/vf_mtest/__resource.lua +++ b/vf_mtest/__resource.lua @@ -9,4 +9,6 @@ client_scripts { "missions/cl_snitch.lua", "missions/cl_missions.lua", "cl_missionsapp.lua" -} \ No newline at end of file +} + +server_script "sv_missionsapp.lua" \ No newline at end of file diff --git a/vf_mtest/missions/cl_dispatch.lua b/vf_mtest/missions/cl_dispatch.lua index 2a8a993..d3ee58f 100644 --- a/vf_mtest/missions/cl_dispatch.lua +++ b/vf_mtest/missions/cl_dispatch.lua @@ -180,6 +180,7 @@ function MissionDispatch.Tick() BeginTextCommandPrint("FM_IHELP_LCP") EndTextCommandPrint(0.1, true) else + payOut = true Missions.Kill() end end @@ -200,6 +201,11 @@ function MissionDispatch.Kill() if DoesEntityExist(vehicle) then DeleteVehicle(vehicle) end + + if payOut then + TriggerServerEvent('vf_mtest:playercut', GetRandomIntInRange(5000, 20000)) + payOut = false + end ClearPrints() SetMaxWantedLevel(5) diff --git a/vf_mtest/missions/cl_ruinermadness.lua b/vf_mtest/missions/cl_ruinermadness.lua index 67b4440..5449afe 100644 --- a/vf_mtest/missions/cl_ruinermadness.lua +++ b/vf_mtest/missions/cl_ruinermadness.lua @@ -38,6 +38,7 @@ function MissionRuinerMadness.Init() while not HasModelLoaded(insurgent2Hash) do Wait(0) end + insurgent2 = CreateVehicle(insurgent2Hash, 2796.07, -707.95, 4.12, 101.43, true) SetModelAsNoLongerNeeded(insurgent2) DecorSetBool(insurgent2, "m_ruinermadness_entity", true) @@ -47,6 +48,7 @@ function MissionRuinerMadness.Init() SetVehicleAsNoLongerNeeded(insurgent2) SetMaxWantedLevel(0) + SetWantedLevelMultiplier(0.0) TriggerMusicEvent("MP_MC_CMH_SUB_FINALE_START") TriggerMusicEvent("MP_MC_CMH_VEHICLE_CHASE") end @@ -66,8 +68,9 @@ function MissionRuinerMadness.Tick() local ruiner2Hash = GetHashKey("ruiner2") RequestModel(ruiner2Hash) while not HasModelLoaded(ruiner2Hash) do - Wait(0) + Wait(10) end + local playerHeading = GetEntityHeading(insurgent2) local targetHeading if playerHeading < 181 then @@ -75,12 +78,15 @@ function MissionRuinerMadness.Tick() else targetHeading = playerHeading - 180 end + local ruiner2 = CreateVehicle(ruiner2Hash, coords.x, coords.y, coords.z, targetHeading, true) - SetModelAsNoLongerNeeded(ruiner2Hash) + while not DoesEntityExist(ruiner2) do + Wait(10) + end + DecorSetBool(ruiner2, "m_ruinermadness_entity", true) SetVehicleDoorsLocked(ruiner2, 4) - SetVehicleEngineOn(ruiner2, true, true) - SetVehicleAsNoLongerNeeded(ruiner2) + SetVehicleEngineOn(ruiner2, true, true) local enemy = CreatePed(4, GetEntityModel(playerPed), coords.x, coords.y, coords.z, 0.0, true) DecorSetBool(enemy, "m_ruinermadness_entity", true) @@ -93,7 +99,6 @@ function MissionRuinerMadness.Tick() SetPedIntoVehicle(enemy, ruiner2, -1) TaskCombatPed(enemy, playerPed, 0, 16) SetPedKeepTask(enemy, true) - SetPedAsNoLongerNeeded(enemy) local enemy2 = CreatePed(4, GetEntityModel(playerPed), coords.x, coords.y, coords.z, 0.0, true) DecorSetBool(enemy2, "m_ruinermadness_entity", true) @@ -107,14 +112,25 @@ function MissionRuinerMadness.Tick() GiveWeaponToPed(enemy2, GetHashKey("WEAPON_APPISTOL"), 999999, false, true) SetPedAccuracy(enemy2, 80) TaskCombatPed(enemy2, playerPed, 0, 16) - SetPedKeepTask(enemy2, true) + SetPedKeepTask(enemy2, true) + + Wait(1400) + + SetVehicleAsNoLongerNeeded(ruiner2) + SetPedAsNoLongerNeeded(enemy) SetPedAsNoLongerNeeded(enemy2) end spawnEnemyTime = 15000 end - if Vdist2(playerCoords, destCoords) < 5.0 or IsPedDeadOrDying(playerPed) then + if Vdist2(playerCoords, destCoords) < 5.0 then + payOut = true Missions.Kill() + else + if IsPedDeadOrDying(playerPed) then + payOut = false + Missions.Kill() + end end end @@ -123,6 +139,20 @@ function MissionRuinerMadness.Kill() ClearPrints() RemoveBlip(destBlip) + if payOut then + TriggerServerEvent('vf_mtest:playercut', GetRandomIntInRange(5000, 20000)) + payOut = false + end + + if DoesEntityExist(insurgent2) then + if IsPedInVehicle(playerPed, insurgent2, false) then + TaskLeaveVehicle(playerPed, insurgent2, 0) + Wait(3000) + end + DeleteEntity(insurgent2) + end + + SetWantedLevelMultiplier(1.0) SetMaxWantedLevel(5) TriggerMusicEvent("MP_MC_STOP") end \ No newline at end of file diff --git a/vf_mtest/missions/cl_securityvan.lua b/vf_mtest/missions/cl_securityvan.lua index 64ad2d8..f552cd5 100644 --- a/vf_mtest/missions/cl_securityvan.lua +++ b/vf_mtest/missions/cl_securityvan.lua @@ -212,7 +212,8 @@ function MissionSecurityVan.Kill() print('Closing Mission') if payOut then - TriggerServerEvent('vf_base:AddCash', GetRandomIntInRange(1000, 5000)) + TriggerServerEvent('vf_mtest:playercut', GetRandomIntInRange(5000, 20000)) + payOut = false end if DoesEntityExist(securityCase) or DoesBlipExist(securityCaseBlip) then diff --git a/vf_mtest/missions/cl_snitch.lua b/vf_mtest/missions/cl_snitch.lua index 0ae136a..f264c8e 100644 --- a/vf_mtest/missions/cl_snitch.lua +++ b/vf_mtest/missions/cl_snitch.lua @@ -191,6 +191,7 @@ function MissionSnitch.Tick() BeginTextCommandPrint("FM_IHELP_LCP") EndTextCommandPrint(0.1, true) else + payOut = true Missions.Kill() end end @@ -221,7 +222,10 @@ function MissionSnitch.Kill() if DoesEntityExist(missionVeh) then if IsPedInVehicle(playerPed, missionVeh, false) then TaskLeaveVehicle(playerPed, missionVeh, 1) - TriggerServerEvent('vf_base:AddCash', GetRandomIntInRange(50, 2000)) + if payOut then + TriggerServerEvent('vf_mtest:playercut', GetRandomIntInRange(5000, 20000)) + payOut = false + end end SetEntityAsNoLongerNeeded(missionVeh) diff --git a/vf_mtest/sv_missionsapp.lua b/vf_mtest/sv_missionsapp.lua new file mode 100644 index 0000000..cf7efb6 --- /dev/null +++ b/vf_mtest/sv_missionsapp.lua @@ -0,0 +1,5 @@ +RegisterServerEvent('vf_mtest:playercut') +AddEventHandler('vf_mtest:playercut', function(price) + local src = source + TriggerEvent('vf_base:AddBank', src, tonumber(price)) +end) \ No newline at end of file From 7768617a8211e5e34d9964471c88ca3f1fa06f9d Mon Sep 17 00:00:00 2001 From: ghermans Date: Tue, 29 Jan 2019 10:37:01 +0100 Subject: [PATCH 2/4] Fixed #48 --- CHANGELOG.md | 4 ++++ vf_base/client/spawn.lua | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cbb9fb..50684b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.1.1 + +- Fixed deathscreen loop when the player changed his skin. + ## 1.1 - Fixed random bugs. diff --git a/vf_base/client/spawn.lua b/vf_base/client/spawn.lua index 5c3e241..6925e06 100644 --- a/vf_base/client/spawn.lua +++ b/vf_base/client/spawn.lua @@ -124,7 +124,12 @@ Citizen.CreateThread(function() while true do Wait(300) if firstTick then - IsPedDead = GetEntityHealth(playerPed) <= 0 + playerPed = PlayerPedId() + if GetEntityHealth(playerPed) <= 0 then + IsPedDead = true + else + IsPedDead = false + end end end end) \ No newline at end of file From efd5567791a30fe8763043c70de80f86a47a177f Mon Sep 17 00:00:00 2001 From: ghermans Date: Tue, 29 Jan 2019 10:39:11 +0100 Subject: [PATCH 3/4] Fixed typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50684b1..8935dfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 1.1.1 -- Fixed deathscreen loop when the player changed his skin. +- Fixed death screen loop when the player changed his skin. ## 1.1 From b03b658acb44f3bbeade213556e75fe9f593f1fa Mon Sep 17 00:00:00 2001 From: ghermans Date: Tue, 29 Jan 2019 10:43:16 +0100 Subject: [PATCH 4/4] Fixed nativeui dependency --- CHANGELOG.md | 1 + vf_base/__resource.lua | 5 ++--- vf_interaction/__resource.lua | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8935dfa..fc41356 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 1.1.1 - Fixed death screen loop when the player changed his skin. +- Removed NativeUI from vf_base. ## 1.1 diff --git a/vf_base/__resource.lua b/vf_base/__resource.lua index d74531c..80e2a51 100644 --- a/vf_base/__resource.lua +++ b/vf_base/__resource.lua @@ -1,11 +1,10 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' resource_type 'gametype' { name = 'venomous-freemode' } -resource_version '1.1' +resource_version '1.1.1' -dependencies {'ghmattimysql', 'NativeUI'} +dependencies {'ghmattimysql'} client_scripts { - '@NativeUI/NativeUI.lua', 'config/freemode.lua', 'config/spawn.lua', 'config/vehicles.lua', diff --git a/vf_interaction/__resource.lua b/vf_interaction/__resource.lua index 7324b75..d12bf04 100644 --- a/vf_interaction/__resource.lua +++ b/vf_interaction/__resource.lua @@ -1,4 +1,5 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' +dependency 'NativeUI' client_scripts { '@NativeUI/NativeUI.lua',