Nickolas Deluca
Member
- Joined
- Dec 7, 2016
- Messages
- 22
- Reaction score
- 6
Hey guys, I'd like to share something I created. I learned from all the scripts that you guys shared in here. If you have any suggestions for improvements, they'll be most welcome.
Lets get to it, both
Add this to
Create a new file called
Add this to
Create a new file called
And thats it I guess. Thank you all for being a great community. I'll share our implementation of an account manager on TFS 1.3 once it is somewhat presentable. lmao.
By the way, I have not tested this in prior versions nor will I try to make them work on your version because I don't have time to do it. Sorry.
Credits to: @roriscave.
Lets get to it, both
!aol
and !bless
are pretty simple but they try to withdraw money from the player's bank account if the player doesn't have money available.!aol command
Add this to
/data/talkactions/talkactions.xml
:
XML:
<talkaction words="!aol" script="aol.lua"/>
Create a new file called
aol.lua
in /data/talkactions/scripts
and paste this in its content:
Lua:
local price_aol = 10000
function onSay(player, words, param)
if player:removeMoney(price_aol) then
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
player:addItem(2173, 1)
else
if player:withdrawMoney(price_aol) then
if player:removeMoney(price_aol) then
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
player:addItem(2173, 1)
end
else
player:getPosition():sendMagicEffect(CONST_ME_POFF)
player:sendCancelMessage("You don't have enought money. Not even in your bank!")
end
end
return true
end
!bless command
Add this to
/data/talkactions/talkactions.xml
:
XML:
<talkaction words="!bless" script="bless.lua"/>
Create a new file called
bless.lua
in /data/talkactions/scripts
and paste this in its content:
Lua:
function addAllBlesses(cid)
local player = Player(cid)
for i = 1, 5 do
if not player:hasBlessing(i) then
player:addBlessing(i, 1)
end
end
end
function onSay(cid)
local player = Player(cid)
local totalBlessPrice = (player:getLevel() * 5 * 5) * 10
if player:removeMoney(totalBlessPrice) then
addAllBlesses(cid)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of five gods!")
else
if player:withdrawMoney(totalBlessPrice) then
if player:removeMoney(totalBlessPrice) then
addAllBlesses(cid)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have been blessed by all of five gods!")
else
player:sendCancelMessage("You don't have enough money. You need " .. totalBlessPrice .. " to buy bless.", cid)
end
else
player:sendCancelMessage("You don't have enough money. Not even in your bank account! You need " .. totalBlessPrice .. " to buy bless.", cid)
end
end
end
And thats it I guess. Thank you all for being a great community. I'll share our implementation of an account manager on TFS 1.3 once it is somewhat presentable. lmao.
By the way, I have not tested this in prior versions nor will I try to make them work on your version because I don't have time to do it. Sorry.
Credits to: @roriscave.
Last edited: