From 56e9201c5711b6853dfb8238514f7002dfd59207 Mon Sep 17 00:00:00 2001 From: broimsuperman Date: Sun, 24 Mar 2024 23:06:59 -0400 Subject: [PATCH 1/2] Update event names in bounty.lua and main.lua --- hitman/[Core]/[Client]/bounty.lua | 8 ++++---- hitman/[Core]/[Client]/main.lua | 10 +++++----- hitman/[Core]/[Server]/main.lua | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/hitman/[Core]/[Client]/bounty.lua b/hitman/[Core]/[Client]/bounty.lua index dd023b8..739353c 100644 --- a/hitman/[Core]/[Client]/bounty.lua +++ b/hitman/[Core]/[Client]/bounty.lua @@ -22,8 +22,8 @@ local Weapons = { -------------------------------------------------------------------------------- -- Core -------------------------------------------------------------------------------- -RegisterNetEvent('RootLodge:BountyHunter:C:SetUpMission') -RegisterNetEvent('RootLodge:BountyHunter:C:ResetTotalKills') +RegisterNetEvent('RootLodge:HitContracts:C:SetUpMission') +RegisterNetEvent('RootLodge:HitContracts:C:ResetTotalKills') -------------------------------------------------------------------------------- TotalKilled = 0 local ArrayBounties = {} @@ -39,7 +39,7 @@ local alwaysfalse = false local alwaystrue = true -------------------------------------------------------------------------------- -AddEventHandler('RootLodge:BountyHunter:C:SetUpMission', function() +AddEventHandler('RootLodge:HitContracts:C:SetUpMission', function() -- Make sure this script does not execute twice. SaveGuard = true @@ -167,6 +167,6 @@ AddEventHandler('RootLodge:BountyHunter:C:SetUpMission', function() GPStoSDboardactive = true end - AddEventHandler('RootLodge:BountyHunter:C:ResetTotalKills', function() + AddEventHandler('RootLodge:HitContracts:C:ResetTotalKills', function() TotalKilled = 0 end) \ No newline at end of file diff --git a/hitman/[Core]/[Client]/main.lua b/hitman/[Core]/[Client]/main.lua index cc83dbf..709844d 100644 --- a/hitman/[Core]/[Client]/main.lua +++ b/hitman/[Core]/[Client]/main.lua @@ -9,7 +9,7 @@ local ActiveMenu = nil local MenuOpen = false local Location = nil -RegisterNetEvent('RootLodge:BountyHunter:C:StartMission') +RegisterNetEvent('RootLodge:HitContracts:C:StartMission') -------------------------------------------------------------------------------- -- Core -------------------------------------------------------------------------------- @@ -54,7 +54,7 @@ Citizen.CreateThread(function() if (dist <= 5) and not InRange then InRange = true Location = v.City - TriggerEvent('RootLodge:BountyHunter:C:StartMission') + TriggerEvent('RootLodge:HitContracts:C:StartMission') end end end @@ -62,7 +62,7 @@ Citizen.CreateThread(function() end) -- Check players distance from the stores. -AddEventHandler('RootLodge:BountyHunter:C:StartMission', function() +AddEventHandler('RootLodge:HitContracts:C:StartMission', function() local ped = PlayerPedId() while InRange do Wait(1) local coords = GetEntityCoords(ped) @@ -138,11 +138,11 @@ function PVEMenu () if hunt then Location = nil - TriggerServerEvent('RootLodge:BountyHunter:S:CheckCharacter') + TriggerServerEvent('RootLodge:HitContracts:S:CheckCharacter') end if payment and (TotalKilled > 0)then - TriggerServerEvent('RootLodge:BountyHunter:S:PayDay', TotalKilled) + TriggerServerEvent('RootLodge:HitContracts:S:PayDay', TotalKilled) TotalKilled = 0 SetGpsMultiRouteRender(false) Location = nil diff --git a/hitman/[Core]/[Server]/main.lua b/hitman/[Core]/[Server]/main.lua index 2e5fe67..98aec6c 100644 --- a/hitman/[Core]/[Server]/main.lua +++ b/hitman/[Core]/[Server]/main.lua @@ -7,15 +7,15 @@ function Wait(args) Citizen.Wait(args) end function Invoke(args, bool) Citizen.InvokeNative(args, bool) end -------------------------------------------------------------------------------- -- Event Register -RegisterServerEvent('RootLodge:BountyHunter:S:PayDay') -RegisterServerEvent('RootLodge:BountyHunter:S:CheckCharacter') +RegisterServerEvent('RootLodge:HitContracts:S:PayDay') +RegisterServerEvent('RootLodge:HitContracts:S:CheckCharacter') -------------------------------------------------------------------------------- -- Core -------------------------------------------------------------------------------- -- Variables -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -AddEventHandler('RootLodge:BountyHunter:S:PayDay', function(KillCount) +AddEventHandler('RootLodge:HitContracts:S:PayDay', function(KillCount) local BPK = Payment.Money.BPK local XPK = Payment.XP.XPK local mMin = Payment.Money.Min @@ -48,17 +48,17 @@ AddEventHandler('RootLodge:BountyHunter:S:PayDay', function(KillCount) xPay = vEXP end - TriggerClientEvent('RootLodge:BountyHunter:C:ResetTotalKills', source) + TriggerClientEvent('RootLodge:HitContracts:C:ResetTotalKills', source) TriggerClientEvent("vorp:TipRight", source, "You received $"..mPay..' and '..xPay..' XP', 5000) end) -AddEventHandler('RootLodge:BountyHunter:S:CheckCharacter', function() +AddEventHandler('RootLodge:HitContracts:S:CheckCharacter', function() local User = VorpCore.getUser(source) if User ~= nil then local Character = User.getUsedCharacter - TriggerClientEvent('RootLodge:BountyHunter:C:SetUpMission', source) + TriggerClientEvent('RootLodge:HitContracts:C:SetUpMission', source) end end) From 4f635a2d73ae6b18b520bf0ec9fd0e3994e67fd7 Mon Sep 17 00:00:00 2001 From: broimsuperman Date: Sun, 24 Mar 2024 23:13:06 -0400 Subject: [PATCH 2/2] Renaming! --- hitman/[Core]/[Client]/bounty.lua | 2 +- hitman/[Core]/[Client]/main.lua | 6 +++--- hitman/config.lua | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hitman/[Core]/[Client]/bounty.lua b/hitman/[Core]/[Client]/bounty.lua index 739353c..a2b9852 100644 --- a/hitman/[Core]/[Client]/bounty.lua +++ b/hitman/[Core]/[Client]/bounty.lua @@ -160,7 +160,7 @@ AddEventHandler('RootLodge:HitContracts:C:SetUpMission', function() end function GPStoBoards () - bb2 = BountyBoards[2] + bb2 = HandlerLocations[2] StartGpsMultiRoute(6, true, true) AddPointToGpsMultiRoute(bb2.x, bb2.y, bb2.z) SetGpsMultiRouteRender(true) diff --git a/hitman/[Core]/[Client]/main.lua b/hitman/[Core]/[Client]/main.lua index 709844d..ac27f09 100644 --- a/hitman/[Core]/[Client]/main.lua +++ b/hitman/[Core]/[Client]/main.lua @@ -23,7 +23,7 @@ end Citizen.CreateThread(function() - for _, board in ipairs(BountyBoards) do + for _, board in ipairs(HandlerLocations) do local blipName = board.City local blipHash = GetHashKey("blip_summer_guard") -- Replace with your blip style addBlipForCoords(blipName, blipHash, {board.x, board.y, board.z}) @@ -36,7 +36,7 @@ Citizen.CreateThread(function() while true do Wait(2000) local ped = PlayerPedId() local coords = GetEntityCoords(ped) - for k, v in pairs(BountyBoards) do + for k, v in pairs(HandlerLocations) do local dist = GetDistanceBetweenCoords(coords.x, coords.y, coords.z, v.x, v.y, v.z) @@ -66,7 +66,7 @@ AddEventHandler('RootLodge:HitContracts:C:StartMission', function() local ped = PlayerPedId() while InRange do Wait(1) local coords = GetEntityCoords(ped) - for k, v in pairs(BountyBoards) do + for k, v in pairs(HandlerLocations) do local x, y, z = v.x, v.y, v.z local dist = GetDistanceBetweenCoords(coords.x, coords.y, coords.z, x, y, z) diff --git a/hitman/config.lua b/hitman/config.lua index cabd533..6ade143 100644 --- a/hitman/config.lua +++ b/hitman/config.lua @@ -29,10 +29,10 @@ Payment = { } } -------------------------------------------------------------------------------- --- Here you can add all BountyBoards Menu locations. +-- Here you can add all HandlerLocations Menu locations. -- The City name does nothing! this is just a visual reference. -------------------------------------------------------------------------------- -BountyBoards = { +HandlerLocations = { { City = 'Valentine', x = -274.8, y = 805.5, z = 119.3 }, { City = 'Saint Denis', x = 2513.4, y = -1305.2, z = 48.9 }, { City = 'Blackwater', x = -758.0, y = -1266.0, z = 44.0 },