Jump to content

export bank reloaded non funziona


-stolka-

Recommended Posts

the debug reports "attempt to perform arithmethic on a nil value line 4" so i tried to see how getBankAccountBalance returns and output it in the chatbox! it outputs 'false' in chatbox

function enterClubConfirmed(  ) 
 oldBalance = exports [ "bank-reloaded" ]:getBankAccountBalance ( "stolka" ) 
 outputChatBox(tostring(oldBalance)) 
 exports [ "bank-reloaded" ]:setBankAccountBalance ( bankAccount, tonumber( oldBalance ) + 120 ) 
 fadeCamera( player, true, 1.5 ) 
 setElementDimension( player, 2 ) 
 setElementInterior( player, 2 ) 
end 
addEvent( "onPlayerClubConfirm", true ) 
addEventHandler( "onPlayerClubConfirm", getRootElement(), enterClubConfirmed ) 

Link to comment
  
function enterClubConfirmed(  ) 
 oldBalance = exports [ "bank-reloaded" ]:getBankAccountBalance ( "stolka" ) 
 if not oldBalance then 
 exports ["bank-reloaded"]:setBankAccountBalance( "stolka", 0) 
 oldBalance = exports [ "bank-reloaded"]:getBankAccountBalance( "stolka" ) 
end 
 outputChatBox(tostring(oldBalance)) 
 exports [ "bank-reloaded" ]:setBankAccountBalance ( bankAccount, tonumber( oldBalance ) + 120 ) 
 fadeCamera( player, true, 1.5 ) 
 setElementDimension( player, 2 ) 
 setElementInterior( player, 2 ) 
end 
addEvent( "onPlayerClubConfirm", true ) 
addEventHandler( "onPlayerClubConfirm", getRootElement(), enterClubConfirmed ) 
  

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...