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

Addon script

Krashe

Mapper
Joined
Nov 22, 2008
Messages
184
Reaction score
5
Location
Sweden
I've been trying to edit and make a perfect addon system. Only thing I got so far is this

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if (getPlayerStorageValue(cid, 21201) == EMPTY_STORAGE) then
                doCreatureSay(cid, "You've gained the citizen outfit.", TALKTYPE_ORANGE_1)
                doPlayerAddOutfit(cid, 128, 3)
                doPlayerAddOutfit(cid, 136, 3)
                setPlayerStorageValue(cid, 21201, 1)
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
        else
                doPlayerSendTextMessage(cid,22,"You already have this addon, or you do not have 100 chicken feathers.")
        end
        return true
end

What this does is when you use a certain item, you get the addon. But I also want it to take some items. Like for this one 50 mino leathers and 100 chicken feathers. If anyone know how to fix this, please reply :)

Thanks
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if (getPlayerStorageValue(cid, 21201) == EMPTY_STORAGE) then
            if doPlayerRemoveItem(cid, 5878, 50) and doPlayerRemoveItem(cid, 5890, 100) then                       
                doCreatureSay(cid, "You've gained the citizen outfit.", TALKTYPE_ORANGE_1)
                doPlayerAddOutfit(cid, 128, 3)
                doPlayerAddOutfit(cid, 136, 3)
                setPlayerStorageValue(cid, 21201, 1)
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
        else
                doPlayerSendTextMessage(cid,22,"You already have this addon, or you do not have 100 chicken feathers and or 50 minotaur leather.")
        end
        end
        return true
end
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if (getPlayerStorageValue(cid, 21201) == EMPTY_STORAGE) then
            if doPlayerRemoveItem(cid, 5878, 50) and doPlayerRemoveItem(cid, 5890, 100) then                       
                doCreatureSay(cid, "You've gained the citizen outfit.", TALKTYPE_ORANGE_1)
                doPlayerAddOutfit(cid, 128, 3)
                doPlayerAddOutfit(cid, 136, 3)
                setPlayerStorageValue(cid, 21201, 1)
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE)
        else
                doPlayerSendTextMessage(cid,22,"You already have this addon, or you do not have 100 chicken feathers and or 50 minotaur leather.")
        end
        end
        return true
end

Thank you my life saver :)
 
Bogart said:
doPlayerAddOutfit(cid, 128, 3)
doPlayerAddOutfit(cid, 136, 3)

I know 128 and 136 are the outfits for m/f but what does the 3 represent?

And what item are you "using" for the script to play out? And what folder is this going into?
 
You can choose the item, add it with itemin/actionid/uniqueid in actions.xml.
The last parameter means amount of addons, addon 0 (none), 1, 2, or 3 for both addons.
 
Back
Top