Hey all,
I made a button for buying repair:
function ButtonRepair()
local Moneyplayer = getElementData(getLocalPlayer(), "Money")
if (Moneyplayer > 3500 ) then
local vehicle = getPedOccupiedVehicle(getLocalPlayer())
fixVehicle(vehicle)
setElementData(getLocalPlayer(),"Money",tostring(moneyplayer-3500))
else
outputChatBox( "You don't have enough money ($3500) to buy repair!", getLocalPlayer(), 0, 150, 255 );
end
end
addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], ButtonRepair, false )
But it isn't working, can anyone help me?
Thanks,
-Chilco