Hi
I made a Script you can buy addons with. You can buy only single addons with this script. You pay with one item you can choose.
To buy you have to write /addon "addonname (e.g. /addon "first citizen)
addons.lua
talkactions.xml
Credits: ballack13 (me)
P.S: I was to lazy to finish the addons. You can do the addons and the storages yourself. Maybe i will finish it later.
I hope you like it.
Please rep++
Your's ballack13
I made a Script you can buy addons with. You can buy only single addons with this script. You pay with one item you can choose.
To buy you have to write /addon "addonname (e.g. /addon "first citizen)
addons.lua
Code:
local config = {
payment = 5952, -- ID of Item which you need to get one addon.
amount = 1, -- Amount of Item which you need to get one addon.
addons = { -- Addon Name, Addon ID, Addon ID, Addon Type, Storage
["first citizen"] = { 136, 128, 1, 10001 },
["second citizen"] = { 136, 128, 2, 10002 },
["first hunter"] = { 137, 129, 1, 20001 },
["second hunter"] = { 137, 129, 2, 20002 },
["first knight"] = { 139, 131, 1, 300001 },
["second knight"] = { 139, 131, 2, 300002 },
["first mage"] = { 138, 130, 1, 40001 },
["second mage"] = { 138, 130, 2, 40002 },
["first summoner"] = { 141, 133, 1, 50001 },
["second summoner"] = { 141, 133, 2, 50002 },
["first barbarian"] = { 147, 143, 1, 60001 },
["second barbarian"] = { 147, 143, 2, 60002 },
["first druid"] = { 148, 144, 1, 70001 },
["second druid"] = { 148, 144, 2, 70002 },
["first nobleman"] = { 140, 132, 1, 80001 },
["second nobleman"] = { 140, 132, 2, 80002 },
["first oriental"] = { 150, 146, 1, 99001 },
["second oriental"] = { 150, 146, 2, 90002 },
["first warrior"] = { 142, 134, 1, 100001 },
["second warrior"] = { 142, 134, 2, 100002 },
["first wizard"] = { 145, 149, 1, 110001 },
["second wizard"] = { 145, 149, 2, 110002 },
["first assassin"] = { 156, 152, 1, 120001 },
["second assassin"] = { 156, 152, 2, 120002 },
["first beggar"] = { 157, 153, 1, 130001 },
["second beggar"] = { 157, 153, 2, 130002 },
}
}
function onSay(cid, words, param)
for name, pos in pairs(config.addons) do
if param == name then
if getPlayerItemCount(cid,config.payment) >= config.amount then
addon = getPlayerStorageValue(cid,pos[4])
if addon == -1 then
doPlayerAddOutfit(cid, pos[1], pos[3])
doPlayerAddOutfit(cid, pos[2], pos[3])
doPlayerRemoveItem(cid,config.payment,config.amount)
setPlayerStorageValue(cid,pos[4],1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought the " .. param .. " addon.")
else
doPlayerSendCancel(cid, "You already have this addon.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "You don't have a addon scroll to buy this addon.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
end
return TRUE
end
talkactions.xml
Code:
<talkaction words="/addon" script="addons.lua" />
Credits: ballack13 (me)
P.S: I was to lazy to finish the addons. You can do the addons and the storages yourself. Maybe i will finish it later.
I hope you like it.
Please rep++
Your's ballack13
Last edited: