SHARE
TWEET

Untitled

a guest Aug 4th, 2011 54 Never
  1. function Lock_OnGossip(Unit, event, player)
  2.         Unit:GossipCreateMenu(100, player, 0)
  3.                 Unit:GossipMenuAddItem( 0, "Test SetPlayerLock(true)", 1, 0)
  4.                 Unit:GossipMenuAddItem( 0, "Test SetPlayerLock(false)", 2, 0)
  5.         Unit:GossipSendMenu(player)
  6. end
  7.  
  8. function Lock_OnSelect(Unit, event, player, id, intid, code, pMisc)
  9.         if (id == 0) then
  10.                 Unit:SendChatMessage(12, 0, "Locking", 0)
  11.                 player:SetPlayerLock(true)
  12.                 player:GossipComplete()
  13.     end
  14.         if (id == 1) then
  15.                 Unit:SendChatMessage(12, 0, "Unlocking", 0)
  16.                 player:SetPlayerLock(false)
  17.                 player:GossipComplete()
  18.     end
  19.  
  20. end
  21.        
  22. RegisterUnitGossipEvent(1000, 1, Lock_OnGossip)
  23. RegisterUnitGossipEvent(1000, 2, Lock_OnSelect)
RAW Paste Data
Top