EvilHero90

gdfgdf

Jun 21st, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.92 KB | None | 0 0
  1. function Round(num)
  2. if num >= 0 then
  3.     return math.floor(num+.5)
  4. else
  5.     return math.ceil(num-.5) end
  6. end
  7.  
  8. function onLook(cid, thing, position, lookDistance)
  9. if isCreature(thing.uid) then
  10.     return true
  11. end
  12.  
  13. local Dash = '-------------------'
  14.  
  15. --[[ Item ID belongs in the key of the table ]]--
  16. local Items = {
  17.     [2643] = {Desc = "Leather Boots\n".. Dash .."\nProtection: 3\nHealing: 1000"}
  18. }
  19.  
  20. local Get = {
  21.     Access = getPlayerAccess(cid),
  22.     ItemID = getItemIdByName,
  23.     ItemName = getItemName(thing.uid),
  24.     ID = thing.itemid,
  25.     AID = thing.actionid,
  26.     UID = thing.uid,
  27.     X = position.x,
  28.     Y = position.y,
  29.     Z = position.z
  30. }
  31.  
  32. --[[ Access required to see special item stats such as item ID or position ]]--
  33. local Access_Required = 3
  34. local GA = Get.Access >= Access_Required
  35.  
  36. local f =
  37. {
  38.     {event = "itemID", func = function(thing) if thing.itemid ~= 0 then return thing.itemid else return false end end},
  39.     {event = "uniqueID", func = function(thing) if thing.uid ~= 70000 then return thing.uid else return false end end},
  40.     {event = "actionID", func = function(thing) if thing.aid ~= 0 then return thing.aid else return false end end},
  41.     {event = "positionX", func = function(position) return position.x end},
  42.     {event = "positionY", func = function(position) return position.y end},
  43.     {event = "positionZ", func = function(position) return position.z end}
  44. }
  45.  
  46. local str = ""
  47. for _, v in ipairs(f) do
  48.     local t = string.find(v.event, "position") and v.func(position) or v.func(thing)
  49.     if t then
  50.         str = str .."".. v.event ..": ".. t .."\n"
  51.     end
  52. end
  53. if str ~= "" then
  54.     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, str)
  55.     return false
  56. end
  57.  
  58.  
  59.  
  60.  
  61. --[[ Don't Touch
  62. if Items[Get.ID] and GA and Get.AID ~= 0 and Get.UID ~= 70000 then
  63.     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "" .. Items[Get.ID].Desc .."\n"..Dash.."\nItemID: ["..Get.ID.."]\nActionID: ["..Get.AID.."]\nUniqueID: ["..Get.UID.."]\nPosition: [X: "..Get.X.."] [Y: "..Get.Y.."] [Z: "..Get.Z.."]")
  64.     return false
  65. end
  66. if Items[Get.ID] and GA and Get.AID ~= 0 then
  67.     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "" .. Items[Get.ID].Desc .."\n"..Dash.."\nItemID: ["..Get.ID.."]\nActionID: ["..Get.AID.."]\nPosition: [X: "..Get.X.."] [Y: "..Get.Y.."] [Z: "..Get.Z.."]")
  68.     return false
  69. end
  70. if Items[Get.ID] and GA and Get.UID ~= 70000 then
  71.     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "" .. Items[Get.ID].Desc .."\n"..Dash.."\nItemID: ["..Get.ID.."]\nUniqueID: ["..Get.UID.."]\nPosition: [X: "..Get.X.."] [Y: "..Get.Y.."] [Z: "..Get.Z.."]")
  72.     return false
  73. end
  74. if Items[Get.ID] and GA then
  75.     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "" .. Items[Get.ID].Desc .."\n"..Dash.."\nItemID: ["..Get.ID.."]\nPosition: [X: "..Get.X.."] [Y: "..Get.Y.."] [Z: "..Get.Z.. "]")
  76.     return false
  77. end
  78. if Items[Get.ID] then
  79.     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "" .. Items[Get.ID].Desc .. "")
  80.     return false
  81. end--]]
  82.  
  83. return true
  84. end
Advertisement
Add Comment
Please, Sign In to add comment