Advertisement
Guest User

Untitled

a guest
Jun 17th, 2018
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. function vRP.hasInventoryItem(user_id, idname)
  2.   local count = vRP.getInventoryItemAmount(user_id, idname)
  3.   return count > 0
  4. end
  5.  
  6. -- get user inventory amount of item
  7. function vRP.getInventoryItemAmount(user_id,idname)
  8.   local data = vRP.getUserDataTable(user_id)
  9.   if data and data.inventory then
  10.     local entry = data.inventory[idname]
  11.     if entry then
  12.       return entry.amount
  13.     end
  14.   end
  15.  
  16.   return 0
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement