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

bank system

Nerevr back

Member
Joined
Nov 7, 2014
Messages
269
Reaction score
7
hello guys anyone can make script if i have balance in bank can buy from action scripts or npc without have money in my backpack buy from balance

im use 0.4 8.60
 
Solution
Action script
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local balance = getPlayerBalance(cid)
local amount = 1000

if (balance >= amount) then
doPlayerSetBalance(cid, balance - amount)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "- ".. amount .." gold from bank. Your account balance is ".. balance .." gold.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_BLUE)
doRemoveItem(item.uid , 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your account balance is ".. balance .." gold. You need ".. amount .." gold.")
end

return true
end
Action script
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local balance = getPlayerBalance(cid)
local amount = 1000

if (balance >= amount) then
doPlayerSetBalance(cid, balance - amount)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "- ".. amount .." gold from bank. Your account balance is ".. balance .." gold.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_BLUE)
doRemoveItem(item.uid , 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your account balance is ".. balance .." gold. You need ".. amount .." gold.")
end

return true
end
 
Last edited:
Solution
Back
Top