Jump to content

[Solved] takePlayerMoney Problem


justn

Recommended Posts

When the player clicks the button, the money does not reduce.

ERROR: Airport_Transportation\client.lua:73: Bad Argument @ 'takePlayerMoney' [Expected number at argument 1, got player]

addEventHandler ( "onClientGUIClick", AirportWindow, 
    function ( b ) 
        if isElementWithinMarker ( localPlayer, LasVenturasMarker ) then 
            if ( b == "left" ) then 
                if ( source == LosSantos ) then 
                    local money = getPlayerMoney(localPlayer)                       
                    if (money > 499) then 
                    setElementPosition(localPlayer, 1642.41553, -2241.73169, 13.49343) 
                    guiSetVisible(AirportWindow,false) 
                    showCursor(false) 
                    takePlayerMoney ( localPlayer, 500 ) 
                else 
                    outputChatBox("You must have at least $500 to go to Los Santos !", localPlayer, 255, 0, 0) 
                end 
            end 
        end 
    end 
end) 

Edited by Guest
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...