• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[mod] -help- How can we buy premium time without money? (with specific item)

kilirt123

New Member
Joined
Jul 11, 2013
Messages
2
Reaction score
0
Location
France
Hello hello !
well I'm new OtLand,

And I was wondering if it was posible to buy premium time with an iteam like ''medal of honour''.. i wouldn't like to use money to buy it..

I hope you'll take a moment for answer me ! :'D




XML CODE :
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Buy premium command" version="1.0" author="" contact="" enabled="yes">
<config name="buypremium_config"><![CDATA[
config = {
days = 30,
cost = 1, < I think that i have to change this ?
maxDays = 360
}
]]></config>
<talkaction words="!buypremium; !pacc; !vip" event="buffer"><![CDATA[
domodlib('buypremium_config')
if(getPlayerPremiumDays(cid) > config.maxDays) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not buy more than " .. config.days + config.maxDays .. " days of Premium Account.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return
end

if(not doPlayerRemoveMoney(cid, config.cost)) then
doPlayerSendCancel(cid, "You don't have premium medal of honour, " .. config.days .. " days premium account costs " .. config.cost .. " medal of honour.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return
end

doPlayerAddPremiumDays(cid, config.days)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought " .. config.days .. " days of premium account.")
]]></talkaction>
</mod>


Thank you !!
 
Last edited:
XML:
XML CODE : 
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Buy premium command" version="1.0" author="" contact="" enabled="yes">
<config name="buypremium_config"><![CDATA[
config = {
days = 30,
cost = 1, < I think that i have to change this ? 
maxDays = 360
}
]]></config>
<talkaction words="!buypremium; !pacc; !vip" event="buffer"><![CDATA[
domodlib('buypremium_config')
if(getPlayerPremiumDays(cid) > config.maxDays) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not buy more than " .. config.days + config.maxDays .. " days of Premium Account.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return
end

if(not doPlayerRemoveMoney(cid, config.cost)) then
doPlayerSendCancel(cid, "You don't have premium medal of honour, " .. config.days .. " days premium account costs " .. config.cost .. " medal of honour.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return
end

doPlayerAddPremiumDays(cid, config.days)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought " .. config.days .. " days of premium account.")
]]></talkaction>
</mod>

You want an item to give premium upon using it?

--edit--

ahh nvm

XML:
 <?xml version="1.0" encoding="UTF-8"?>
<mod name="Buy premium command" version="1.0" author="" contact="" enabled="yes">
<config name="buypremium_config"><![CDATA[
config = {
days = 30,
item = xxxx <!-- item id required to buy premium -->getPlayerItemCount(cid,itemid)
maxDays = 360
}
]]></config>
<talkaction words="!buypremium; !pacc; !vip" event="buffer"><![CDATA[
domodlib('buypremium_config')
if(getPlayerPremiumDays(cid) > config.maxDays) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not buy more than " .. config.days + config.maxDays .. " days of Premium Account.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return
end

if getPlayerItemCount(cid, config.item) < 1 then
doPlayerSendCancel(cid, "You don't have premium medal of honour, " .. config.days .. " days premium account costs 1x medal of honour.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return
end

doPlayerAddPremiumDays(cid, config.days)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought " .. config.days .. " days of premium account.")
]]></talkaction>
</mod>

This should work for what you want. Unless you wanted something else. Next time use support.
 
Last edited:
sorry tetra20, i'm newbie and i don't know how to use lua tag :S
Thank you owned ;D it's working good !
thanks for the advices ;P

- - - Updated - - -

how can i give reputation please? :S
 

Similar threads

Back
Top