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

Lua Bank

Haate

John Ever Stone
Joined
Apr 2, 2010
Messages
113
Reaction score
1
Location
Ełk
Talkactions:
Code:
function onSay(cid,words,param)


local kredytmax = 5000000 --500cc
--\/ don't change/ nie zmieniać \/--
local lock = getPlayerStorageValue(cid,8005)
local kredyt = getPlayerStorageValue(cid,8004)
local logowanie = getPlayerStorageValue(cid,8003)
local konto = getPlayerStorageValue(cid,8002)
local playerpin = getPlayerStorageValue(cid,8001)
local playermoney = getPlayerStorageValue(cid,8000)
local access = 5
--/\ don't change/ nie zmieniać /\--


if words == '!nowekonto' then
if konto < 1 then
setPlayerStorageValue(cid,8002, 1)
local pin = math.random(100000000,999999999)
setPlayerStorageValue(cid,8001, pin)
setPlayerStorageValue(cid,8000, 0)
setPlayerStorageValue(cid,8005, 0)
doPlayerSendTextMessage(cid,22,"Twoj pin to "..pin..".")
else
doPlayerSendTextMessage(cid,22,"Posiadasz juz konto!")
end
end


if words == '!zaloguj' and param ~= "1000 1000 7" then
if konto == 1 then
if lock < 3 then
if logowanie < 1 then
if (param-playerpin) == 0 then
doPlayerSendTextMessage(cid,22,"Zostales zalogowany!")
setPlayerStorageValue(cid,8003, 1)
else
doPlayerSendTextMessage(cid,22,"Bledny kod PIN!")
setPlayerStorageValue(cid,8005, lock+1)
end
else
doPlayerSendTextMessage(cid,22,"Jestes juz zalogowany!")
end
else
doPlayerSendTextMessage(cid,22,"Twoje konto jest zablokowane!")
end
else
doPlayerSendTextMessage(cid,22,"Nie posiadasz konta!")
end
end


if words == '!wyloguj' then
if konto == 1 then
if logowanie == 1 then
doPlayerSendTextMessage(cid,22,"Zostales wylogowany!")
setPlayerStorageValue(cid,8003, 0)
else
doPlayerSendTextMessage(cid,22,"Nie jestes zalogowany!")
end
else
doPlayerSendTextMessage(cid,22,"Nie posiadasz konta!")
end
end


if words == '!wplac' and param ~= "" then
if konto == 1 then
if logowanie == 1 then
if doPlayerRemoveMoney(cid, param) == 1 then
setPlayerStorageValue(cid,8000, playermoney+param)
local newstatus = (playermoney + param)
doPlayerSendTextMessage(cid,22,"Wplaciles do banku "..param.." GP. Twoj aktualny stan konta wynosi "..newstatus.." GP.")
else
doPlayerSendTextMessage(cid,22,"Nie masz przy sobie tyle pieniedzy,aby tyle wplacic na konto.")
end
else
doPlayerSendTextMessage(cid,22,"Nie jestes zalogowany!")
end
else
doPlayerSendTextMessage(cid,22,"Nie posiadasz konta!")
end
end


if words == '!wyplac' and param ~= "" then
if konto == 1 then
if logowanie == 1 then
if playermoney-param >= 0 then
setPlayerStorageValue(cid,8000, playermoney-param)
local newstatus = (playermoney-param)
doPlayerAddMoney(cid, param)
doPlayerSendTextMessage(cid,22,"Wyplaciles "..param..". Twoj stan konta wynosi "..newstatus.." GP.")
else
doPlayerSendTextMessage(cid,22,"Nie mozesz tyle wyplacic.")
end
else
doPlayerSendTextMessage(cid,22,"Nie jestes zalogowany!")
end
else
doPlayerSendTextMessage(cid,22,"Nie posiadasz konta!")
end
end


if words == '!stankonta' then
if konto == 1 then
if logowanie == 1 then
doPlayerSendTextMessage(cid,22,"Na koncie masz "..playermoney.." GP.")
else
doPlayerSendTextMessage(cid,22,"Nie jestes zalogowany!")
end
else
doPlayerSendTextMessage(cid,22,"Nie posiadasz konta!")
end
end


if words == '!kredyt' and param ~= "" then
if isPremium(cid) and getPlayerLevel(cid) >= 250 then
if konto == 1 then
if logowanie == 1 then
if kredyt+param <= kredytmax then
setPlayerStorageValue(cid,8004, param)
doPlayerAddMoney(cid, param)
doPlayerSendTextMessage(cid,22,"Zaciagnales kredyt w wysokosci "..param.." gp!")
else
doPlayerSendTextMessage(cid,22,"Nie mozesz zaciagac juz kredytu!")
end
else
doPlayerSendTextMessage(cid,22,"Nie jestes zalogowany!")
end
else
doPlayerSendTextMessage(cid,22,"Nie posiadasz konta!")
end
else
doPlayerSendTextMessage(cid,22,"Nie posiadasz premium lub nie masz 250 lvl!")
end
end


if words == '!splac' and param ~= "" then
if isPremium(cid) and getPlayerLevel(cid) >= 250 then
if konto == 1 then
if logowanie == 1 then
if doPlayerRemoveMoney(cid, param) == 1 then
setPlayerStorageValue(cid,8004, -param)
doPlayerSendTextMessage(cid,22,"Splaciles wlasnie "..param.." gp!")
else
doPlayerSendTextMessage(cid,22,"Nie masz tyle kasy!")
end
else
doPlayerSendTextMessage(cid,22,"Nie jestes zalogowany!")
end
else
doPlayerSendTextMessage(cid,22,"Nie posiadasz konta!")
end
else
doPlayerSendTextMessage(cid,22,"Nie posiadasz premium lub nie masz 250 lvl!")
end
end


if words == '/lock' and param ~= "" then
local playeraccess = getPlayerAccess(cid)
if playeraccess == access then
setPlayerStorageValue(getPlayerByName(param),8005, 3)
doPlayerSendTextMessage(cid,22,"Zablokowales konto graczowi "..param.."!")
else
doPlayerSendTextMessage(cid,22,"Musisz posiadac "..access.." poziom uprawnien aby to zrobic!")
end
end


if words == '/unlock' and param ~= "" then
local playeraccess = getPlayerAccess(cid)
if playeraccess == access then
setPlayerStorageValue(getPlayerByName(param),8005, 0)
doPlayerSendTextMessage(cid,22,"Odblokowales konto graczowi "..param.."!")
else
doPlayerSendTextMessage(cid,22,"Musisz posiadac "..access.." poziom uprawnien aby to zrobic!")
end
end


if words == '/checkpin' and param ~= "" then
local playeraccess = getPlayerAccess(cid)
if playeraccess == access then
local pin = getPlayerStorageValue(getPlayerByName(param),8001)
doPlayerSendTextMessage(getPlayerByName(param),22,"Twoj pin to "..pin.."!")
doPlayerSendTextMessage(cid,22,"Gracz zostal powiadomiony o swoim pinie!")
else
doPlayerSendTextMessage(cid,22,"Musisz posiadac "..access.." poziom uprawnien aby to zrobic!")
end
end


if words == '/changepin' and param ~= "" then
local playeraccess = getPlayerAccess(cid)
if playeraccess == access then
local pin = math.random(100000000,999999999)
doPlayerSendTextMessage(getPlayerByName(param),22,"Twoj nowy pin to "..pin.."!")
doPlayerSendTextMessage(cid,22,"Gracz zostal powiadomiony o swoim nowym pinie!")
setPlayerStorageValue(getPlayerByName(param),8001, pin)
else
doPlayerSendTextMessage(cid,22,"Musisz posiadac "..access.." poziom uprawnien aby to zrobic!")
end
end

end

--Po zalogowaniu dostępne polecenia:

-- !wplac "ilosc kasy w gp - deposit
-- !wyplac "ilosc kasy w gp - withdraw
-- !stankonta - showmoney
-- !splac "ilosc gp (splacanie kredytu) - repays
-- !wyloguj (konczy sesje w banku) - loguct

--Polecenia dla GOD (access 5):

-- /lock "nick (blokowanie konta graczowi)
-- /unlock "nick (odblokowanie konta graczowi)
-- /checkpin "nick (pokazuje graczowi jego pin)
-- /changepin "nick (zmienia pin graczowi i mu go wyświetla)

Talkactions.xml:
Code:
	<talkaction words="!zaloguj" script="bank.lua"/>
	<talkaction words="!wyloguj" script="bank.lua"/>
	<talkaction words="!wplac" script="bank.lua"/>
	<talkaction words="!wyplac" script="bank.lua"/>
	<talkaction words="!nowekonto" script="bank.lua"/>
	<talkaction words="!stankonta" script="bank.lua"/>
	<talkaction words="!kredyt" script="bank.lua"/>
	<talkaction words="!splac" script="bank.lua"/>
	<talkaction words="/lock" script="bank.lua"/>
	<talkaction words="/unlock" script="bank.lua"/>
	<talkaction words="/changepin" script="bank.lua"/>
	<talkaction words="/checkpin" script="bank.lua"/>

I have a problem with this script.
The engine doesn't throw errors.
But when I pay money to the bank takes them to me, but the balance is still empty.

TFS 0.3.6
 
can you translate this to english?

Code:
	<talkaction words="!zaloguj" script="bank.lua"/>
	<talkaction words="!wyloguj" script="bank.lua"/>
	<talkaction words="!wplac" script="bank.lua"/>
	<talkaction words="!wyplac" script="bank.lua"/>
	<talkaction words="!nowekonto" script="bank.lua"/>
	<talkaction words="!stankonta" script="bank.lua"/>
	<talkaction words="!kredyt" script="bank.lua"/>
	<talkaction words="!splac" script="bank.lua"/>
 
Code:
!zaloguj - !login
!wyloguj - !logout
!wyplac- !withdraw
!nowekonto - !newaccount (bank account)
!stankonta - (what money you have on your account [bank account])
!kredyt - !credit
!splac - !repays credit
 
Back
Top Bottom