daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Jan 29th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function DrawText2(text)
  2.     SetTextFont(0)
  3.     SetTextProportional(1)
  4.     SetTextScale(0.0, 0.50)
  5.     SetTextDropshadow(1, 0, 0, 0, 255)
  6.     SetTextEdge(1, 0, 0, 0, 255)
  7.     SetTextDropShadow()
  8.     SetTextOutline()
  9.     SetTextEntry("STRING")
  10.     AddTextComponentString(text)
  11.     DrawText(0.40, 0.10)
  12. end
  13.  
  14. function getInventoryWeight(pPlayer)
  15.   local weight = 0
  16.   local itemWeight = 0
  17.  
  18.   if #pPlayer.inventory > 0 then
  19.       for i=1, #pPlayer.inventory, 1 do
  20.         if pPlayer.inventory[i] ~= nil then
  21.           itemWeight = Config.DefaultWeight
  22.           if arrayWeight[pPlayer.inventory[i].name] ~= nil then
  23.             itemWeight = arrayWeight[pPlayer.inventory[i].name]
  24.           end
  25.           weight = weight + (itemWeight * pPlayer.inventory[i].count)
  26.         end
  27.       end
  28.   end
  29.  
  30.   return weight
  31. end
  32.  
  33. Citizen.CreateThread(function()
  34.     while true do
  35.         Citizen.Wait(0)
  36.  
  37.         local sizeInv = getInventoryWeight(PlayerId())
  38.         DrawText2("InvWeight: ~r~".. sizeInv .." ~w~.")
  39.     end
  40. end)
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top