Likes: 0
Results 1 to 2 of 2
Thread: [Lua] Item Getter *Share*
-
18-05-10, 08:52 PM #1
[Lua] Item Getter *Share*
Register to remove this adCode:local NPC_ID = 50033 function NPC_OnGossipTalk(pUnit, event, player) pUnit:GossipCreateMenu(1, player, 1) pUnit:GossipMenuAddItem(1, "Claim a Item.", 1, 1) pUnit:GossipMenuAddItem(1, "Claim a Spell", 3, 0) pUnit:GossipMenuAddItem(1, "Nevermind.", 2, 0) pUnit:GossipSendMenu(player) end function NPC_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc) if(intid == 1) then if (player:GetGmRank() == 'a') or (player:GetGmRank() == 'az') then local select = WorldDBQuery("SELECT * FROM items WHERE entry = "..code.."") local PlayerName = player:GetName() local AccountName = player:GetAccountName() local Rank = player:GetGmRank() if(select == NULL) then player:SendBroadcastMessage("|cFFFF7401DF[NOTICE]:|r This doesn't exist!") player:GossipComplete() else player:AddItem(code, 1) player:SendBroadcastMessage("|cFFFF0000[NOTICE]:|r You have recieved Item ID "..code.." and this transaction has been logged to the database.") WorldDBQuery("INSERT INTO item_logs (`Entry`, `Character`, `Account`, `Rank`, `Item ID`, `Date`, `Time`) VALUES ('0', '"..PlayerName.."', '"..AccountName.."', '"..Rank.."', '"..code.."','"..os.date("%X").."', '"..os.date("%x").."');") player:GossipComplete() end else player:SendBroadcastMessage("|cFFFF0000[NOTICE]:|r You need to be a <GM> or <Admin> to use this Feature!") end end if(intid == 2) then player:GossipComplete() end end if(intid == 3) then if (player:GetGmRank() == 'a') or (player:GetGmRank() == 'az') or (player:GetGmRank() == 3) or (player:GetGmRank() == vip) then local select = WorldDBQuery("SELECT * FROM items WHERE entry = "..code.."") local PlayerName = player:GetName() local AccountName = player:GetAccountName() local Rank = player:GetGmRank() if(select == NULL) then player:SendBroadcastMessage("|cFFFF7401DF[NOTICE]:|r This doesn't exist!") player:GossipComplete() else player:LearnSpell(code, 1) player:SendBroadcastMessage("|cFFFF0000[NOTICE]:|r You have recieved Item ID "..code.." and this transaction has been logged to the database.") WorldDBQuery("INSERT INTO item_logs (`Entry`, `Character`, `Account`, `Rank`, `Item ID`, `Date`, `Time`) VALUES ('0', '"..PlayerName.."', '"..AccountName.."', '"..Rank.."', '"..code.."','"..os.date("%X").."', '"..os.date("%x").."');") player:GossipComplete() end else player:SendBroadcastMessage("|cFFFF0000[NOTICE]:|r You need to be a <GM> or <Admin> to use this Feature!") end end if(intid == 2) then player:GossipComplete() end RegisterUnitGossipEvent(NPC_ID, 1, "NPC_OnGossipTalk") RegisterUnitGossipEvent(NPC_ID, 2, "NPC_OnGossipSelect")
› See More: [Lua] Item Getter *Share*
Just got my pc back
-
19-05-10, 01:22 PM #2
Register to remove this adIt's really nice, never seen an idea like this before.