Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.11 KB | None | 0 0
  1. Citizen.CreateThread(function()
  2.     while true do
  3.         Citizen.Wait(8)
  4.         local player = PlayerPedId()
  5.         local pos = GetEntityCoords(PlayerPedId())
  6.         local entity = Citizen.InvokeNative(0xD806CD2A4F2C2996, PlayerPedId())
  7.         local model = GetEntityModel(entity)
  8.         local entType = GetEntityType(entity)
  9.         local type = GetPedType(entity)
  10.         local hasSkin = false
  11.         local hasBody = false
  12.         local carriedEntityHash = 0
  13.         local sellString = ""
  14.         if entType == 3 then -- Skin/Pelt
  15.             hasSkin = true
  16.             carriedEntityHash = Citizen.InvokeNative(0x31FEF6A20F00B963, entity)
  17.             sellString = GetLabelTextByHash(carriedEntityHash)
  18.         elseif type == 28 then
  19.             carriedEntityHash = Citizen.InvokeNative(0x964000D355219FC0, entity)
  20.             hasBody = true
  21.             sellString = GetLabelTextByHash(carriedEntityHash)
  22.         end
  23.         for k,v in pairs(Config.Coords) do
  24.             if Vdist(pos, v) < 2 then
  25.                 if hasSkin == true then
  26.                     local foundAniminal = false
  27.                     for k,v in pairs(pelt_list) do
  28.                         if  v.name == sellString then
  29.                             price = v.price
  30.                             foundAniminal = true
  31.                             break
  32.                         end
  33.                     end
  34.                     if foundAniminal == false then
  35.                         sellString = "Cannot find this pelt please report as a bug "
  36.                         price = 0
  37.                     end
  38.                     DrawTxt("Press Enter to sell Pelt: "..sellString.." for "..price, 0.50, 0.95, 0.6, 0.6, true, 255, 255, 255, 255, true, 10000)
  39.                 elseif hasBody == true then
  40.                     local foundAniminal = false
  41.                     for k,v in pairs(body_list) do
  42.                         if  v.name == sellString then
  43.                             price = v.price
  44.                             foundAniminal = true
  45.                             break
  46.                         end
  47.                     end
  48.                     if foundAniminal == false then
  49.                         sellString = "Cannot find this body please report as a bug "
  50.                         price = 0
  51.                     end
  52.                     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)
  53.                 end
  54.                 if IsControlJustReleased(0, keys['ENTER']) then
  55.                     while DoesEntityExist(entity) == 1 do
  56.                         Citizen.Wait(100)
  57.                         SetEntityAsMissionEntity(entity)
  58.                         DeleteEntity(entity)
  59.                     end
  60.                     TriggerServerEvent("wwrp_butcher:SellItems", price)
  61.                 end
  62.             end
  63.         end
  64.     end
  65. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement