Jump to content

getAccount and addAccount not working


Dolinho

Recommended Posts

the getaccont not to be working someone help me with this? :oops:

function createDB() 
    if (not getAccount("batSystem")) then 
        DataBase = addAccount("batSystem", "batSystem") 
    elseif (getAccount("batSystem")) then 
        DataBase = getAccount("batSystem", "batSystem") 
    end 
end 
addEventHandler("onResourceStart", resourceRoot, createDB) 
  
function depositMoney(amount, text) 
    local group = getPlayerGroup(client) 
    if (not group) then return end 
    local id= amount 
    local current = getElementData(root, "Batalhao:"..group..":bank") or 0 
    local new = current + amount 
    setAccountData(DataBase, "Batalhao:"..group..":bank", tonumber(new)) 
    aaa = getAccountData(DataBase, "Batalhao:"..group..":bank") 
    setElementData(root, "Batalhao:"..group..":logs", "" ..getPlayerName(client).." Depositou + R$: "..amount.."\n"..text) 
    outputChatBox("Depositado $"..id.." Para o batalhao "..aaa, client, 0, 255, 0) 
end 
addEvent("batalhao.SendMoneyBank", true) 
addEventHandler("batalhao.SendMoneyBank", root, depositMoney) 
  

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...