Wysłany: 2013-10-21, 22:42
cayman11
Wiek: 30 Na forum: 4948 dni Posty: 73
function DepozytDoBanku ( amount )
if not ( tonumber ( amount ) <= 0 ) then
local Saldo = getAccountData ( getPlayerAccount ( source ), "bank" )
takePlayerMoney ( source , amount )
amount2 = Saldo + amount
setAccountData ( getPlayerAccount ( source ), "bank" , amount2 )
outputChatBox ( "Twoje konto w banku: " .. amount2 .. "$" , source , 255 , 255 , 0 )
else
outputChatBox ( "--- " .. amount .. "$" , source , 255 , 0 , 0 )
end
end
addEvent ( "DepozytBank" , true )
addEventHandler ( "DepozytBank" , getRootElement (), DepozytDoBanku )
function WyplacZBanku ( amount )
local KartaBanku = getAccountData ( getPlayerAccount ( source ), "bank" )
if ( tonumber ( amount ) <= tonumber ( KartaBanku )) then
if( tonumber ( amount ) >= 1 ) then
amount2 = KartaBanku - amount
setAccountData ( getPlayerAccount ( source ), "bank" , amount2 )
givePlayerMoney ( source , amount )
outputChatBox ( "Twoje konto w banku: " .. amount2 .. "$" , source , 255 , 255 , 0 )
else
outputChatBox ( "Wyp?acanie " .. amount .. "$ jest niemo?liwe!" , source , 255 , 0 , 0 )
end
else
outputChatBox ( "Wprowadzono nieprawid?ow? warto??!" , source , 255 , 0 , 0 )
outputChatBox ( "Twoje konto w banku: " .. KartaBanku .. "$!" , source , 255 , 0 , 0 )
end
end
addEvent ( "Wyplac" , true )
addEventHandler ( "Wyplac" , getRootElement (), WyplacZBanku )
I tutaj jest pytanie jak zrobi? aby kwota w banku si? zapisywa?a po wyj?ciu z serwera itp?
Wysłany: 2013-10-21, 23:11
krydianero
Samotny Wilk
Wiek: 33 Na forum: 4783 dni Posty: 395
Nick w MP: Yoshida
Piwa : 1798
Mam nadziej? ?e pomog?em
function zapiszbank ()
local kwota = getAccountData ( getPlayerAccount ( source ), 'bank' )
setAccountData ( getPlayerAccount ( source ), 'bank' , kwota )
end
addEventHandler ( 'onPlayerLogout' , getRootElement (), zapiszbank )
addEventHandler ( 'onPlayerQuit' , getRootElement (), zapiszbank )
Podpis
Multi Drive Unlimited:Nowy projekt już wkrótce
Tagi: bank
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: