-stolka- Posted September 7, 2014 Share Posted September 7, 2014 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
Anubhav Posted September 7, 2014 Share Posted September 7, 2014 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now