Skip to content

Commit

Permalink
Merge pull request #13 from AndrewR3K/bugfix-itemspread
Browse files Browse the repository at this point in the history
Small Animals Ped Check
  • Loading branch information
outsider31000 authored Apr 27, 2022
2 parents 51226b8 + 454a712 commit c18fdd5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions vorp_hunting/client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,18 @@ Citizen.CreateThread(function()
if event == 1376140891 then
local view = exports["vorp_hunting"]:DataViewNativeGetEventData(0, index, 3)
local pedGathered = view['2']
local ped = view['0']
local model = GetEntityModel(pedGathered)

-- Ensure the player who enacted the event is the one who gets the rewards
local player = PlayerPedId()
local playergate = player == ped

-- print('Correct Player:', playergate)

print('Animal Gathered: ' ..model)

if model and Config.SmallAnimals[model] ~= nil then
local smallAnimal = Config.SmallAnimals[model]
if model and Config.SmallAnimals[model] ~= nil and playergate == true then
print('Animal Gathered: ' ..model)
local smallAnimal = Config.SmallAnimals[model]
local givenItem = smallAnimal.givenItem
local givenAmount = smallAnimal.givenAmount
local money = smallAnimal.money
Expand Down

0 comments on commit c18fdd5

Please sign in to comment.