Advertisement
Guest User

code

a guest
Oct 22nd, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.33 KB | None | 0 0
  1. local config = {
  2. [4001] = { name = "Full Citizen Addon", addon_type = 3, outfit = {136,128}, cost = 40 },
  3. [4002] = { name = "Full Hunter Addon", addon_type = 3, outfit = {137,129}, cost = 30 },
  4. [4003] = { name = "First Mage Addon", addon_type = 1, outfit = {138,130}, cost = 50, },
  5. [4004] = { name = "Full Knight Addon", addon_type = 3, outfit = {139,131}, cost = 30 },
  6. [4005] = { name = "Full Nobleman Addon", addon_type = 3, outfit = {140,132}, cost = 30 },
  7. [4006] = { name = "Full Summoner Addon", addon_type = 3, outfit = {141,133}, cost = 60 },
  8. [4007] = { name = "Full Warrior Addon", addon_type = 3, outfit = {142,134}, cost = 60 },
  9. [4008] = { name = "Full Barbarian Addon", addon_type = 3, outfit = {147,143}, cost = 60 },
  10. [4009] = { name = "Full Druid Addon", addon_type = 3, outfit = {148,144}, cost = 35 },
  11. [4010] = { name = "Full Wizard Addon", addon_type = 3, outfit = {149,145}, cost = 45 },
  12. [4011] = { name = "Full Oriental Addon", addon_type = 3, outfit = {150,146}, cost = 45 },
  13. [4012] = { name = "Full Pirate Addon", addon_type = 3, outfit = {155,151}, cost = 30 },
  14. [4013] = { name = "Full Assassin Addon", addon_type = 3, outfit = {156,152}, cost = 60 },
  15. [4014] = { name = "Full Beggar Addon", addon_type = 3, outfit = {157,153}, cost = 40 },
  16. [4015] = { name = "Full Shaman Addon", addon_type = 3, outfit = {158,154}, cost = 30 },
  17. [4016] = { name = "Full Norseman Addon", addon_type = 3, outfit = {252,251}, cost = 30 },
  18. [4017] = { name = "Full Nightmare Addon", addon_type = 3, outfit = {269,268}, cost = 30 },
  19. [4018] = { name = "Full Jester Addon", addon_type = 3, outfit = {270,273}, cost = 45 },
  20. [4019] = { name = "Full Brotherhood Addon", addon_type = 3, outfit = {279,278}, cost = 35 },
  21. [4020] = { name = "Full Demonhunter Addon", addon_type = 3, outfit = {288,289}, cost = 55 },
  22. [4021] = { name = "Full Yalaharian Addon", addon_type = 3, outfit = {324,325}, cost = 35 },
  23. [4022] = { name = "Full Warmaster Addon", addon_type = 3, outfit = {336,335}, cost = 45 },
  24. [4023] = { name = "Full Wayfarer Addon", addon_type = 3, outfit = {366,367}, cost = 60 }
  25. }
  26. local storage = 14000
  27. local MessageGet = "You paid "..addon.cost.." in "..addon.name.." and you have "..getPlayerStorageValue(cid, 176602).."."
  28. local MessageFail = "You need "..addon.cost.." task points for the "..addon.name.." and you have "..getPlayerStorageValue(cid, 176602).."."
  29. local MessageHave = "You already have the "..addon.name.."."
  30.  
  31. function onUse(cid, item, fromPosition, itemEx, toPosition)
  32. local addon, removeItems, removeMoney = config[item.actionid], 0, 0
  33. if getPlayerStorageValue(cid, storage + item.actionid) ~= 1 then
  34. if getPlayerStorageValue(cid, 176602) >= addon.cost then
  35. removePoints = 1
  36. end
  37. if removePoints == 1 then
  38. doPlayerRemoveMoney(cid, addon.cost)
  39. doPlayerAddOutfit(cid, addon.outfit[1], addon.addon_type)
  40. doPlayerAddOutfit(cid, addon.outfit[2], addon.addon_type)
  41. setPlayerStorageValue(cid, storage + item.actionid, 1)
  42. doPlayerSendTextMessage(cid, 21, MessageGet)
  43. setPlayerStorageValue(cid, 176602, getPlayerStorageValue(cid, 176602)-addon.cost)
  44. else
  45. doPlayerSendTextMessage(cid, 21, MessageFail)
  46. end
  47.  
  48. else
  49. doPlayerSendTextMessage(cid, 21, MessageHave)
  50. end
  51. return TRUE
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement