Advertisement
Guest User

addon.lua

a guest
Jun 16th, 2014
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. local femaleOutfits = {["citizen"]={136}, ["hunter"]={137}, ["mage"]={138}, ["knight"]={139}, ["noblewoman"]={140}, ["summoner"]={141}, ["warrior"]={142}, ["barbarian"]={147}, ["druid"]={148}, ["wizard"]={149}, ["oriental"]={150}, ["pirate"]={155}, ["assassin"]={156}, ["beggar"]={157}, ["shaman"]={158}, ["norsewoman"]={252}, ["nightmare"]={269}, ["jester"]={270}, ["brotherhood"]={279}, ["demonhunter"]={288}, ["yalaharian"]={324}, ["warmaster"]={336}}
  2. local maleOutfits = {["citizen"]={128}, ["hunter"]={129}, ["mage"]={130}, ["knight"]={131}, ["nobleman"]={132},["summoner"]={133}, ["warrior"]={134}, ["barbarian"]={143}, ["druid"]={144}, ["wizard"]={145}, ["oriental"]={146}, ["pirate"]={151}, ["assassin"]={152}, ["beggar"]={153}, ["shaman"]={154}, ["norsewoman"]={251}, ["nightmare"]={268}, ["jester"]={273}, ["brotherhood"]={278}, ["demonhunter"]={289}, ["yalaharian"]={325}, ["warmaster"]={335}, ["wayfarer"]={366}}
  3. local addonDoll = 9693
  4.  
  5. local addonParam = {
  6. ["first"] = 1,
  7. ["second"] = 2,
  8. }
  9.  
  10.  
  11. function onSay(cid, words, param)
  12. local paramtwo = string.explode(param, ",")
  13. local sex = nil
  14.  
  15. if getPlayerSex(cid) > 0 then
  16.  
  17. sex = femaleOutfits
  18. else
  19.  
  20. sex = maleOutfit
  21. end
  22.  
  23. if not sex[paramtwo[1]:lower()] then
  24.  
  25. doPlayerSendCancel(cid, "Esta outfit não existe.")
  26. return true
  27. end
  28.  
  29. if not isInArray({"first", "second"}, paramtwo[2]) then
  30.  
  31. doPlayerSendCancel(cid, "Voce não está executando um parametro válido.")
  32. return true
  33. end
  34.  
  35. if(doPlayerRemoveItem(cid, addonDoll, 1) == true) then
  36.  
  37. doPlayerAddOutfit(cid, sex[paramtwo[1]:lower], addonParam[paramtwo[2]:lower)
  38. doPlayerSendCancel(cid, "Voce adicionou um novo addon.")
  39. doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
  40. return true
  41. else
  42.  
  43. doPlayerSendCancel(cid, "Voce não tem um addon doll.")
  44. doSendMagicEffect(getThingPos(cid), 2)
  45. return true
  46. end
  47. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement