Guest User

Talkaction.lua

a guest
Jul 10th, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. local config = {
  2.  
  3. doorPosition = {x = 1056, y = 1046, z = 5},
  4. doorID = 13099,
  5. minAccess = 5,
  6. seconds_time = 3 -- / * New * /
  7. message = {
  8.  
  9. doorOpen = "O Portal do evento de Bag abriu!",
  10. doorClose = "O Portal fechou!"
  11. }
  12. }
  13.  
  14. local function closeDoor(cid)
  15.  
  16. doCreateItem(config.doorID, 1, config.doorPosition)
  17. doPlayerSendTextMessage(cid, 22, config.message.doorClose)
  18. return true
  19. end
  20.  
  21. function onSay(cid, words, param)
  22. if getPlayerAccess(cid) >= config.minAccess then
  23.  
  24. local item = getTileItemById(config.doorPosition, config.doorID)
  25.  
  26. if item.uid > 0 then
  27.  
  28. doRemoveItem(item.uid, 1)
  29. doPlayerSendTextMessage(cid, 22, config.message.doorOpen)
  30. addEvent(closeDoor, config.seconds_time * 1000, cid)
  31. end
  32. end
  33. return true
  34. end
Advertisement
Add Comment
Please, Sign In to add comment