Onforum.net - Web and gaming resource community

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members .

Quests /Python Advanced Banking System

Vanilla

Elite
Elite
Credits
1,180
Let me introduce you briefly.

Players can create their bank account by typing a password, choosing a security question and choosing the answer.
They can sign in with their password or if they don't remember, they can reset it, but only if they have the answer to their security questions.
They can also change their data.

If the player fails to pass his password 5 times while logging in or answers the security question, he cannot login or reset his password for 2 hours.

First you need to add these functions and variables to your questlib.lua file:
Code:
bank_path = '/game/bank'

function readline(path, x)
    local linetable = {}
    for line in io.lines(path..'/'..pc.name) do
        table.insert(linetable, line)
    end
    return linetable[x]
end
    
function write_in_file(path, text)
    if string.find(text, "%[ENTER%]") then
        text = string.gsub(text, "%[ENTER%]", "n")
    end
    local file = io.open(path..'/'..pc.name, 'w')
    file:write(text)
    file:close()
end
The next step is to create a folder named bank or whatever you want the name, but you have to type the path of this folder in bank_path . All information about the player's bank account will be saved in this folder. (Things like bank password, security question, answer to security question and finally saved gold). And now the task: (I will indicate the places you need to edit )
 
Thread starter Similar threads Forum Replies Date
Quests /Python 0

Similar threads


Top

Dear User!

We found that you are blocking the display of ads on our site.

Please add it to the exception list or disable AdBlock.

The advertises that you'll see aren't intrusive they just help us to keep the community alive

If you don't want to see those ads just buy an upgrade.

Thank you for understanding!

Rogue

Rogue Purchase

User upgrade! at

🔥 Upgrade Now
Baba2

Baba2 Purchase

User upgrade! at

🔥 Upgrade Now

Escanor25 Purchase

User upgrade! at

🔥 Upgrade Now