Hello!
I wrote a script that will buy us a blessing with the command LOLOL. The script buy only blessings for which to be, which fulfills the requirements (premium account) and only those who have not taken out ... When you use a command is sent to us the message of the report, which bought a blessing for which we can not afford that were previously taken out and those that do not meet requirements. I decided to publish it because it is a little more advanced than those of simple, published long ago in the forum.
data/talkactions/scripts/blessing.lua:
data/talkactions/talkactions.xml
To buy bless use only: !bless
Yours,
Azi.
I wrote a script that will buy us a blessing with the command LOLOL. The script buy only blessings for which to be, which fulfills the requirements (premium account) and only those who have not taken out ... When you use a command is sent to us the message of the report, which bought a blessing for which we can not afford that were previously taken out and those that do not meet requirements. I decided to publish it because it is a little more advanced than those of simple, published long ago in the forum.
data/talkactions/scripts/blessing.lua:
PHP:
-- // config // --
local bless = {
{cost = 10000, premium = "no", name="First"},
{cost = 10000, premium = "no", name="Second"},
{cost = 10000, premium = "no", name="Third"},
{cost = 10000, premium = "yes", name="Fourth"},
{cost = 10000, premium = "yes", name="Fifth"},
}
-- // end // --
-- // do not touch! // --
local blessings = {}
local cost = 0
local msg = "Blessing buying report: "
-- // Blessing command script by ersiu // --
function onSay(cid, words, param)
for i, blessing in ipairs(bless) do
if getPlayerBlessing(cid, i) == TRUE then
if doPlayerRemoveMoney(cid, blessing.cost) == TRUE then
if (isPremium(cid) == TRUE or string.lower(blessing.premium) == "no") then
msg = msg.."\n "..blessing.name.." bought successfuly"
cost = cost+blessing.cost
table.insert(blessing, i)
else
msg = msg.."\n "..blessing.name.." not bought, to get you need premium."
end
else
msg = msg.."\n "..blessing.name.." not bought, to get you need "..blessing.cost.." gp."
end
else
msg = msg.."\n "..blessing.name.." already bought."
end
end
for _, addBless in ipairs(blessings) do
doPlayerAddBlessing(cid, addBless)
end
doPlayerSendTextMessage(cid, 19, msg..".\n Total Cost: "..cost.." gp.")
return TRUE
end
-- // END // --
data/talkactions/talkactions.xml
PHP:
<talkaction log="no" words="!bless" access="0" event="script" value="blessing.lua"/>
To buy bless use only: !bless
Yours,
Azi.
Last edited: