justn Posted March 13, 2014 Share Posted March 13, 2014 (edited) 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 March 13, 2014 by Guest Link to comment
Castillo Posted March 13, 2014 Share Posted March 13, 2014 takePlayerMoney client side has only one argument, the amount. But, if you take the player client side, then it won't be synchronized with the server, which means is not really taking it. Link to comment
justn Posted March 13, 2014 Author Share Posted March 13, 2014 Oh...I understand now, thanks, I fixed the problem 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