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

Npc who sell warmaster addon!

Aklovo

Enjoy It
Joined
Dec 30, 2009
Messages
453
Reaction score
12
Location
México
Any idea how to do a npc who sell warmaster addon? and the price will be 50 orbs :D
 
Well, I'm using it atm.

Example:
!addon warmaster (1kk)

XML:
<talkaction words="!addon" event="script" value="addons.lua"/>

Addons.lua:
Code:
  local outfits =
{
    ["warmaster"] = { male = 335, female = 336, addon = 3, cost = 1000000 }
}

function onSay(cid, words, param)
    if param == "" then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This is an invalid param.")
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
    return TRUE
    end
-- Male --
    if getPlayerSex(cid) == 1 and doPlayerRemoveMoney(cid, outfits[param].cost) == TRUE then
        doPlayerAddOutfit(cid, outfits[param].male, outfits[param].addon)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have just recieved an addon.")
    else
        doPlayerSendCancel(cid, "You must have ".. outfits[param].cost .." gold coins to get this addon.")
    return TRUE
    end
-- Female --
    if getPlayerSex(cid) == 0 and doPlayerRemoveMoney(cid, outfits[param].cost) == TRUE then
        doPlayerAddOutfit(cid, outfits[param].female, outfits[param].addon)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have just recieved an addon.")
    else
        doPlayerSendCancel(cid, "You must have ".. outfits[param].cost .." gold coins to get this addon.")
    return TRUE
    end
end
 
Last edited:
Code:
local outfits = {
    ["warmaster"] = { male = 335, female = 336, addon = 3, cost = 1000000 }
}
function onSay(cid, words, param)
	local n = outfits[param:lower()]
	if n then
		if doPlayerRemoveMoney(cid, n.cost) == TRUE then
			doPlayerAddOutfit(cid, n.male, n.addon)
			doPlayerAddOutfit(cid, n.female, n.addon)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have just recieved an addon.")
		else
			doPlayerSendCancel(cid, "You must have ".. n.cost .." gold coins to get this addon.")
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This is an invalid param.")
 		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
	end
	return TRUE
end
 
Back
Top