Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions hitman/[Core]/[Client]/bounty.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand All @@ -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

Expand Down Expand Up @@ -160,13 +160,13 @@ AddEventHandler('RootLodge:BountyHunter: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)
GPStoSDboardactive = true
end

AddEventHandler('RootLodge:BountyHunter:C:ResetTotalKills', function()
AddEventHandler('RootLodge:HitContracts:C:ResetTotalKills', function()
TotalKilled = 0
end)
16 changes: 8 additions & 8 deletions hitman/[Core]/[Client]/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local ActiveMenu = nil
local MenuOpen = false
local Location = nil

RegisterNetEvent('RootLodge:BountyHunter:C:StartMission')
RegisterNetEvent('RootLodge:HitContracts:C:StartMission')
--------------------------------------------------------------------------------
-- Core
--------------------------------------------------------------------------------
Expand All @@ -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})
Expand All @@ -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)

Expand All @@ -54,19 +54,19 @@ 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
end
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)
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)

Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions hitman/[Core]/[Server]/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions hitman/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down