• 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!

[Error] Mods shop.xml

Status
Not open for further replies.

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="action-shop" version="1.0" author="slawkens" contact="[email protected]" enabled="yes">
    <config name="action-shop-config"><![CDATA[
        items = {
            -- health potions
            [3001] =    {itemid = 7591,    cost = 3900, backpack = 2000, name = "backpack of great health potions"},
            [3002] =    {itemid = 8473,    cost = 6300, backpack = 2000, name = "backpack of ultimate health potions"},
            [3003] =    {itemid = 7588,    cost = 2300, backpack = 2000, name = "backpack of strong health potion"}

            -- runes
            [3004] =    {itemid = 2268,    cost = 7100, backpack = 2003, name = "backpack of sudden death runes",        charges = 75},
            [3005] =    {itemid = 2273,    cost = 6100, backpack = 2002, name = "backpack of ultimate healing runes",    charges = 75},
			[3006] =    {itemid = 2313,    cost = 2450, backpack = 2001, name = "backpack of explosion rune",    charges = 75},
            [3007] =    {itemid = 2293,    cost = 2500, backpack = 2004, name = "backpack of magic wall",    charges = 75}

			-- other
			[3008] =    {itemid = 2268,    cost = 500,    name = "sudden death runes"},
			[3009] =    {itemid = 8473,    cost = 500,    name = "ultimate healing runes"},
			[3010] =    {itemid = 2278,    cost = 800,    name = "paralyse"},
			[3011] =    {itemid = 2305,    cost = 500,    name = "firebomb"},
			[3012] =    {itemid = 2274,    cost = 500,    name = "avalance"},
			[3013] =    {itemid = 2313,    cost = 500,    name = "explosion rune"},
			[3014] =    {itemid = 2293,    cost = 500,    name = "magic wall"}
        }
    ]]></config>

    <action fromaid="3001" toaid="3014" event="script"><![CDATA[
        domodlib('action-shop-config')
        local items = items

        function onUse(cid, item, fromPosition, itemEx, toPosition)
            local tmp = items[item.actionid]
            if(not tmp) then
                error('ERROR - action-shop mod: actionid is empty.')
                return false
            end

            local count = (tmp.count ~= nil and tmp.count or 1)
            local charges = (tmp.charges ~= nil and tmp.charges or 1)

            if(tmp.backpack) then
                if(doPlayerBuyItemContainer(cid, tmp.backpack, tmp.itemid, 1, tmp.cost, charges)) then
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought a " .. tmp.name .. ".")
                else
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have enought money. (" .. tmp.cost .. "gp)")
                end
            else
                if(doPlayerBuyItem(cid, tmp.itemid, count, tmp.cost, charges)) then
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought " .. tmp.name .. ".")
                else
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have enought money. (" .. tmp.cost .. "gp)")
                end
            end

            return true
        end
    ]]></action>
</mod>

which fail ??

wewqe_ahehrw.png
 
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="action-shop" version="1.0" author="slawkens" contact="[email protected]" enabled="yes">
	<action actionid="3001-3014" event="script"><![CDATA[
		local items = {
			-- health potions
			[3001] =    {itemid = 7591,    cost = 3900, backpack = 2000, name = "backpack of great health potions"},
			[3002] =    {itemid = 8473,    cost = 6300, backpack = 2000, name = "backpack of ultimate health potions"},
			[3003] =    {itemid = 7588,    cost = 2300, backpack = 2000, name = "backpack of strong health potion"},

			-- runes
			[3004] =    {itemid = 2268,    cost = 7100, backpack = 2003, name = "backpack of sudden death runes",        charges = 75},
			[3005] =    {itemid = 2273,    cost = 6100, backpack = 2002, name = "backpack of ultimate healing runes",    charges = 75},
			[3006] =    {itemid = 2313,    cost = 2450, backpack = 2001, name = "backpack of explosion rune",    charges = 75},
			[3007] =    {itemid = 2293,    cost = 2500, backpack = 2004, name = "backpack of magic wall",    charges = 75},

			-- other
			[3008] =    {itemid = 2268,    cost = 500,    name = "sudden death runes"},
			[3009] =    {itemid = 8473,    cost = 500,    name = "ultimate healing runes"},
			[3010] =    {itemid = 2278,    cost = 800,    name = "paralyse"},
			[3011] =    {itemid = 2305,    cost = 500,    name = "firebomb"},
			[3012] =    {itemid = 2274,    cost = 500,    name = "avalance"},
			[3013] =    {itemid = 2313,    cost = 500,    name = "explosion rune"},
			[3014] =    {itemid = 2293,    cost = 500,    name = "magic wall"}
		}

		function onUse(cid, item, fromPosition, itemEx, toPosition)
			local v = items[item.actionid]
			if(not v) then
				error('ERROR - action-shop mod: actionid is empty.')
				return false
			end

			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, v.backpack and (doPlayerBuyItemContainer(cid, v.backpack, v.itemid, 1, v.cost, v.charges or 1) and "You bought a " .. v.name .. "." or "You don't have enought money. (" .. v.cost .. "gp)") or (doPlayerBuyItem(cid, v.itemid, v.count or 1, v.cost, v.charges or 1) and "You bought " .. v.name .. "." or "You don't have enought money. (" .. v.cost .. "gp)"))

			return true
		end
	]]></action>
</mod>
 
open again... cyko have one fail in ur script ;s
in the bp only appers 20 charges and potion (x1 on slot of backpack) not (x20) and 100 charges

@edit
and "others" only appers 1x dont appers x25
 
Last edited:
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="action-shop" version="1.0" author="slawkens" contact="[email protected]" enabled="yes">
	<config name="action-shop-config"><![CDATA[
		items = {
			-- health potions
			[3001] =    {itemid = 7591,    cost = 3900, backpack = 2000, name = "backpack of great health potions"},
            [3002] =    {itemid = 8473,    cost = 6300, backpack = 2000, name = "backpack of ultimate health potions"},
            [3003] =    {itemid = 7588,    cost = 2300, backpack = 2000, name = "backpack of strong health potion"},
			
			-- runes
			[3004] =	{itemid = 2268,	cost = 7100, backpack = 2003, name = "backpack of sudden death runes",		charges = 3},
			[3005] =	{itemid = 2273,	cost = 6100, backpack = 2002, name = "backpack of ultimate healing runes",	charges = 2},
			[3006] = 	{itemid = 2313, cost = 2450, backpack = 2001, name = "backpack of explosion rune",    charges = 3},
			[3007] = 	{itemid = 2293, cost = 2500, backpack = 2004, name = "backpack of magic wall",    charges = 2},

			-- other
			[3008] = {itemid = 2268,    cost = 500,    name = "sudden death runes"},
			[3009] = {itemid = 8473,    cost = 500,    name = "ultimate healing runes"},
			[3010] = {itemid = 2278,    cost = 800,    name = "paralyse"},
			[3011] = {itemid = 2305,    cost = 500,    name = "firebomb"},
			[3012] = {itemid = 2274,    cost = 500,    name = "avalance"},
			[3013] = {itemid = 2313,    cost = 500,    name = "explosion rune"},
			[3014] = {itemid = 2293,    cost = 500,    name = "magic wall"}
		}
	]]></config>

	<action fromaid="3001" toaid="3013" event="script"><![CDATA[
		domodlib('action-shop-config')
		local items = items

		function onUse(cid, item, fromPosition, itemEx, toPosition)
			local tmp = items[item.actionid]
			if(not tmp) then
				error('ERROR - action-shop mod: actionid is empty.')
				return false
			end

			local count = (tmp.count ~= nil and tmp.count or 1)
			local charges = (tmp.charges ~= nil and tmp.charges or 1)

			if(tmp.backpack) then
				if(doPlayerBuyItemContainer(cid, tmp.backpack, tmp.itemid, 1, tmp.cost, charges)) then
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought a " .. tmp.name .. ".")
				else
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have enought money. (" .. tmp.cost .. "gp)")
				end
			else
				if(doPlayerBuyItem(cid, tmp.itemid, count, tmp.cost, charges)) then
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought " .. tmp.name .. ".")
				else
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have enought money. (" .. tmp.cost .. "gp)")
				end
			end

			return true
		end
	]]></action>
</mod>

i need put all items in backpack with 20x container in backpack more 100x of potions
and i need put all others with 25x

thx all ;x
 
Last edited:
XML:
<?xml version='1.0' encoding='UTF-8'?>
<mod name='action-shop' version='1.0' author='slawkens' contact='[email protected]' enabled='yes'>
	<action actionid='3001-3019' event='script'><![CDATA[
		local items={
			-- health potions
			[3001] = {itemid=7618, charges=100, cost=1000, backpack=2000, name='backpack of health potions'},
			[3002] = {itemid=7588, charges=100, cost=2100, backpack=2000, name='backpack of strong health potions'},
			[3003] = {itemid=7591, charges=100, cost=3900, backpack=2000, name='backpack of great health potions'},
			[3004] = {itemid=8473, charges=100, cost=6300, backpack=2000, name='backpack of ultimate health potions'},
 
			-- mana potions
			[3005] = {itemid=7620, charges=100, cost=1100, backpack=2001, name='backpack of mana potions'},
			[3006] = {itemid=7589, charges=100, cost=1700, backpack=2001, name='backpack of strong mana potions'},
			[3007] = {itemid=7590, charges=100, cost=2500, backpack=2001, name='backpack of great mana potions'},
 
			-- spirit potions
			[3008] = {itemid=8472, charges=100, cost=3900, backpack=1999, name='backpack of great spirit potions'},
 
			-- runes
			[3009] = {itemid=2268, charges=100, cost=7100, backpack=2003, name='backpack of sudden death runes'},
			[3010] = {itemid=2273, charges=100, cost=6100, backpack=2002, name='backpack of ultimate healing runes'},
			[3011] = {itemid=2313, charges=100, cost=2450, backpack=2001, name='backpack of explosion rune'},
			[3012] = {itemid=2293, charges=100, cost=2500, backpack=2004, name='backpack of magic wall'},
 
			-- other
			[3013] = {itemid=2268, charges=25, cost=500, name='sudden death runes'},
			[3014] = {itemid=8473, charges=25, cost=500, name='ultimate healing runes'},
			[3015] = {itemid=2278, charges=25, cost=800, name='paralyze rune'},
			[3016] = {itemid=2305, charges=25, cost=500, name='firebomb rune'},
			[3017] = {itemid=2274, charges=25, cost=500, name='avalance rune'},
			[3018] = {itemid=2313, charges=25, cost=500, name='explosion rune'},
			[3019] = {itemid=2293, charges=25, cost=500, name='magic wall rune'}

		}
 
		function onUse(cid, item, fromPosition, itemEx, toPosition)
			local v=items[item.actionid]
			if(not v) then
				error('ERROR - action-shop mod: actionid is empty.')
				return false
			end
 
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, v.backpack and (doPlayerBuyItemContainer(cid, v.backpack, v.itemid, 1, v.cost, v.charges or 1) and 'You bought a ' .. v.name .. '.' or 'You don\'t have enought money. (' .. v.cost .. 'gp)') or (doPlayerBuyItem(cid, v.itemid, v.charges or 1, v.cost, 1) and 'You bought ' .. (v.charges or 1) ..'x ' .. v.name .. '.' or 'You don\'t have enought money. (' .. v.cost .. 'gp)'))
 
			return true
		end
	]]></action>
</mod>
 
Status
Not open for further replies.
Back
Top