Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(8)
- local player = PlayerPedId()
- local pos = GetEntityCoords(PlayerPedId())
- local entity = Citizen.InvokeNative(0xD806CD2A4F2C2996, PlayerPedId())
- local model = GetEntityModel(entity)
- local entType = GetEntityType(entity)
- local type = GetPedType(entity)
- local hasSkin = false
- local hasBody = false
- local carriedEntityHash = 0
- local sellString = ""
- if entType == 3 then -- Skin/Pelt
- hasSkin = true
- carriedEntityHash = Citizen.InvokeNative(0x31FEF6A20F00B963, entity)
- sellString = GetLabelTextByHash(carriedEntityHash)
- elseif type == 28 then
- carriedEntityHash = Citizen.InvokeNative(0x964000D355219FC0, entity)
- hasBody = true
- sellString = GetLabelTextByHash(carriedEntityHash)
- end
- for k,v in pairs(Config.Coords) do
- if Vdist(pos, v) < 2 then
- if hasSkin == true then
- local foundAniminal = false
- for k,v in pairs(pelt_list) do
- if v.name == sellString then
- price = v.price
- foundAniminal = true
- break
- end
- end
- if foundAniminal == false then
- sellString = "Cannot find this pelt please report as a bug "
- price = 0
- end
- DrawTxt("Press Enter to sell Pelt: "..sellString.." for "..price, 0.50, 0.95, 0.6, 0.6, true, 255, 255, 255, 255, true, 10000)
- elseif hasBody == true then
- local foundAniminal = false
- for k,v in pairs(body_list) do
- if v.name == sellString then
- price = v.price
- foundAniminal = true
- break
- end
- end
- if foundAniminal == false then
- sellString = "Cannot find this body please report as a bug "
- price = 0
- end
- DrawTxt("Press Enter to sell body of: "..sellString.." for "..price, 0.50, 0.95, 0.6, 0.6, true, 255, 255, 255, 255, true, 10000)
- end
- if IsControlJustReleased(0, keys['ENTER']) then
- while DoesEntityExist(entity) == 1 do
- Citizen.Wait(100)
- SetEntityAsMissionEntity(entity)
- DeleteEntity(entity)
- end
- TriggerServerEvent("wwrp_butcher:SellItems", price)
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement