Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. function getItemsInContainer(cont, sep)
  2. local text = ""
  3. local tsep = ""
  4. local count = ""
  5. for i=1, sep do
  6. tsep = tsep.."-"
  7. end
  8. tsep = tsep..">"
  9. for i=0, getContainerSize(cont.uid)-1 do
  10. local item = getContainerItem(cont.uid, i)
  11. if isContainer(item.uid) == FALSE then
  12. if item.type > 0 then
  13. count = "("..item.type.."x)"
  14. end
  15. text = text.."\n"..tsep..getItemNameById(item.itemid).." "..count
  16. else
  17. if getContainerSize(item.uid) > 0 then
  18. text = text.."\n"..tsep..getItemNameById(item.itemid)
  19. text = text..getItemsInContainer(item, sep+2)
  20. else
  21. text = text.."\n"..tsep..getItemNameById(item.itemid)
  22. end
  23. end
  24. end
  25. return text
  26. end
  27.  
  28. function onSay(cid, words, param, channel)
  29. if(param == "") then
  30. doPlayerSendCancel(cid, "Command requires param.")
  31. return TRUE
  32. end
  33. local slotName = {"Head Slot", "Amulet Slot", "Backpack Slot", "Armor Slot", "Right Hand", "Left Hand", "Legs Slot", "Feet Slot", "Ring Slot", "Ammo Slot"}
  34. local player = getPlayerByNameWildcard(param)
  35. if isPlayer(player) == TRUE then
  36. local text = getPlayerName(player).."'s Equipment: "
  37. for i=1, 10 do
  38. text = text.."\n\n"
  39. local item = getPlayerSlotItem(player, i)
  40. if item.itemid > 0 then
  41. if isContainer(item.uid) == TRUE then
  42. text = text..slotName[i]..": "..getItemNameById(item.itemid)..getItemsInContainer(item, 1)
  43. else
  44. text = text..slotName[i]..": "..getItemNameById(item.itemid)
  45. end
  46. else
  47. text = text..slotName[i]..": Empty"
  48. end
  49. end
  50. doShowTextDialog(cid, 6579, text)
  51. else
  52. doPlayerSendCancel(cid, "This player is not online.")
  53. end
  54. return TRUE
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement