• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Buy Addon Talkactions

Norix

Hosting Service !
Joined
Jan 18, 2008
Messages
544
Reaction score
8
Location
Germany
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
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:
Learn tabbing... Cause you tried to tab but it was a big phail please? kthxbye

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
tabbed for you...
 
sux only for money, i relase it many time ago (in pl's forums) but i have new system (not relased) - addons for items like: 50 honeycomb, 100 chicken feathers and legion helmet. ; )
That's roox. ;d
 
sux only for money, i relase it many time ago (in pl's forums) but i have new system (not relased) - addons for items like: 50 honeycomb, 100 chicken feathers and legion helmet. ; )
That's roox. ;d

Yea that's easy to make, but takes ALOT time ;S
 
You can take other items too not only money. I made the script for pplz who wanna sell a special item in SMS Shop or sth. and for that item they can make a addon..

Your's ballack13
 
Code:
local config = {
    addons = { -- Addon Name, Addon ID, Addon ID, Addon Type, Storage, ItemID1, ItemID2, ItemID3 (NULL if no item), AmountID1, AmountID2, AmountID3.
		["first citizen"] = { 136, 128, 1, 10001, Blah, Blah, NULL, amount1, amount2, amount3 },
		["second citizen"] = { 136, 128, 2, 10002, Blah, Blah, NULL, amount1, amount2, amount3 },
		["first hunter"] = { 137, 129, 1, 20001, Blah, Blah, NULL, amount1, amount2, amount3 },
		["second hunter"] = { 137, 129, 2, 20002, Blah, Blah, NULL, amount1, amount2, amount3 },
		["first knight"] = { 139, 131, 1, 300001, Blah, Blah, NULL, amount1, amount2, amount3 },
		["second knight"] = { 139, 131, 2, 300002, Blah, Blah, NULL, amount1, amount2, amount3 },
		["first mage"] = { 138, 130, 1, 40001, Blah, Blah, NULL, amount1, amount2, amount3 },
		["second mage"] = { 138, 130, 2, 40002, Blah, Blah, NULL, amount1, amount2, amount3 },
		["first summoner"] = { 141, 133, 1, 50001, Blah, Blah, NULL, amount1, amount2, amount3 },
		["second summoner"] = { 141, 133, 2, 50002, Blah, Blah, NULL, amount1, amount2, amount3 },
		["first barbarian"] = { 147, 143, 1, 60001, Blah, Blah, NULL, amount1, amount2, amount3 },
		["second barbarian"] = { 147, 143, 2, 60002, Blah, Blah, NULL, amount1, amount2, amount3 },
		["first druid"] = { 148, 144, 1, 70001, Blah, Blah, NULL, amount1, amount2, amount3 },
		["second druid"] = { 148, 144, 2, 70002, Blah, Blah, NULL, amount1, amount2, amount3 },
		["first nobleman"] = { 140, 132, 1, 80001, Blah, Blah, NULL, amount1, amount2, amount3 },
		["second nobleman"] = { 140, 132, 2, 80002, Blah, Blah, NULL, amount1, amount2, amount3 },
		["first oriental"] = { 150, 146, 1, 99001, Blah, Blah, NULL, amount1, amount2, amount3 },
		["second oriental"] = { 150, 146, 2, 90002, Blah, Blah, NULL, amount1, amount2, amount3 },
		["first warrior"] = { 142, 134, 1, 100001, Blah, Blah, NULL, amount1, amount2, amount3 },
		["second warrior"] = { 142, 134, 2, 100002, Blah, Blah, NULL, amount1, amount2, amount3 },
		["first wizard"] = { 145, 149, 1, 110001, Blah, Blah, NULL, amount1, amount2, amount3 },
		["second wizard"] = { 145, 149, 2, 110002, Blah, Blah, NULL, amount1, amount2, amount3 },
		["first assassin"] = { 156, 152, 1, 120001, Blah, Blah, NULL, amount1, amount2, amount3 },
		["second assassin"] = { 156, 152, 2, 120002, Blah, Blah, NULL, amount1, amount2, amount3 },
		["first beggar"] = { 157, 153, 1, 130001, Blah, Blah, NULL, amount1, amount2, amount3 },
		["second beggar"] = { 157, 153, 2, 130002, Blah, Blah, NULL, amount1, amount2, amount3 },
    }
}



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 ~= TRUE then
					doPlayerAddOutfit(cid, pos[1], pos[3])
					doPlayerAddOutfit(cid, pos[2], pos[3])
					doPlayerRemoveItem(cid, pos[5], pos[8])
					doPlayerRemoveItem(cid, pos[6], pos[9])
					doPlayerRemoveItem(cid, pos[7], pos[10])
					setPlayerStorageValue(cid, pos[4], TRUE)
					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
 
Back
Top