function tilisiirto2 ( thePlayer, command, target, amount )
local target = getPlayerFromName ( target )
if ( target ) then
local amount = tonumber ( amount )
local account = getPlayerAccount ( thePlayer )
local targetAccount = getPlayerAccount ( target )
if ( not isGuestAccount ( account ) ) then
local cash = tonumber ( getAccountData ( account, "nordea-cash" ) ) or 0
local targetCash = tonumber ( getAccountData ( targetAccount, "nordea-cash" ) ) or 0
if ( cash >= amount and amount > 0 ) then
local money = ( targetCash + amount )
setAccountData ( targetAccount, "nordea-cash", money ) --[[ + money to target --]]
local money1 = ( cash - amount )
setAccountData ( account, "nordea-cash", money1 )
outputChatBox ("#0000FF[Nordea]#00FF00 ".. amount .."$ siirretty pelaajan ".. getPlayerName ( target ) .." tilille.", thePlayer, 0, 255, 0, true )
outputChatBox ("#0000FF[Nordea]#00FF00 Sait ".. amount .."$ pelaajalta ".. getPlayerName ( thePlayer ) .." tilillesi.", target, 0, 255, 0, true )
local bankSayAmount = getAccountData ( targetAccount, "nordea-cash" )
if ( bankSayAmount ) then
outputChatBox ( "#ffff00[Nordea]#FFFF00 Uusi saldo on ".. bankSayAmount .."$", target, 255, 255, 0, true )
else
outputChatBox ( "#0000FF[Nordea]#FF0000 Syöttämäsi rahamäärä ei ole kelvollinen.", thePlayer, 255, 0, 0, true )
end
end
end
end
end
addCommandHandler ( "tilisiirto", tilisiirto2 )