Skip to content

Commit

Permalink
Merge pull request #49 from FiveM-Scripts/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ghermans authored Jan 29, 2019
2 parents 769d8d6 + b03b658 commit 85780b7
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.1.1

- Fixed death screen loop when the player changed his skin.
- Removed NativeUI from vf_base.

## 1.1

- Fixed random bugs.
Expand Down
5 changes: 2 additions & 3 deletions vf_base/__resource.lua
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
7 changes: 6 additions & 1 deletion vf_base/client/spawn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 1 addition & 0 deletions vf_interaction/__resource.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
dependency 'NativeUI'

client_scripts {
'@NativeUI/NativeUI.lua',
Expand Down
4 changes: 3 additions & 1 deletion vf_mtest/__resource.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ client_scripts {
"missions/cl_snitch.lua",
"missions/cl_missions.lua",
"cl_missionsapp.lua"
}
}

server_script "sv_missionsapp.lua"
6 changes: 6 additions & 0 deletions vf_mtest/missions/cl_dispatch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ function MissionDispatch.Tick()
BeginTextCommandPrint("FM_IHELP_LCP")
EndTextCommandPrint(0.1, true)
else
payOut = true
Missions.Kill()
end
end
Expand All @@ -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)
Expand Down
44 changes: 37 additions & 7 deletions vf_mtest/missions/cl_ruinermadness.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -66,21 +68,25 @@ 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
targetHeading = playerHeading + 180
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)
Expand All @@ -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)
Expand All @@ -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

Expand All @@ -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
3 changes: 2 additions & 1 deletion vf_mtest/missions/cl_securityvan.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion vf_mtest/missions/cl_snitch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ function MissionSnitch.Tick()
BeginTextCommandPrint("FM_IHELP_LCP")
EndTextCommandPrint(0.1, true)
else
payOut = true
Missions.Kill()
end
end
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions vf_mtest/sv_missionsapp.lua
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 85780b7

Please sign in to comment.