Jump to content

how get Bankbalance


daKillar2000

Recommended Posts

Bank resource has a number of exported functions, 2 of them are:

setBankAccountBalance( player or accountName, newBalance ) 
getBankAccountBalance( player or accountName ) 

They are obviously server-side functions to be safer.

Link to comment

-client side

  
    addEvent("banklabel", true ) 
    function banklabel( ) 
       bank = tonumber(balance) 
       guiSetText(DaPlayerBank,"Bank:  $   "  ..tostring(thePlayer,balance)) 
    end   
  

serverside

  function bankstatus (source) 
 local account = getPlayerAccount (source); 
 if not isGuestAccount(account) then 
      local balance = getBankAccountBalance(source)  
      triggerClientEvent (source,"banklabel",source,balance) 
     end 
 end 
  

Link to comment
... 
local balance = exports.bank:getBankAccountBalance( source ) -- make sure source is player element or account name 
... 

... 
function banklabel( balance ) 
    guiSetText(DaPlayerBank,"Bank:  $   "  ..tostring(balance)) 
... 

Link to comment

ok i put that but not works again

i do this:

----Serverside

     function bankstatus (source) 
          local account = getPlayerAccount (source); 
          local balance = exports.bank:getBankAccountBalance( source )  
          triggerClientEvent (source,"banklabel",source,balance) 
        end 

-----ClientSide

    addEvent("banklabel", true ) 
     function banklabel( balance ) 
       guiSetText(DaPlayerBank,"Bank:  $   "  ..tostring(balance)) 
   end   

I Dont Know Why Not Works

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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