Cyan Posted June 22, 2011 Share Posted June 22, 2011 I am working on a Vehicles System and i need some help with Vehicles Sloths, i want to make 4 vehicles slots in the GUI and idk how Link to comment
Kenix Posted June 22, 2011 Share Posted June 22, 2011 https://wiki.multitheftauto.com/wiki/Int ... ng_the_GUI Link to comment
CowTurbo Posted June 22, 2011 Share Posted June 22, 2011 I think the easyest way for doing that is seting accountData. When player boughts car, then set he's account data to that vehicle what he did bought. So, if you wanna do that with different buttons.. -- For buying car function buyCar1 ( carName,price ) local playerAccount = getPlayerAccount ( source ) local car1 = getAccountData ( playerAccount, "Car1" ) if not( car1 ) then if ( getPlayerMoney => price ) then setAccountData ( playerAccount, "Car1", carName ) -- For model, you can do getVehicleModelFromName function, setAccountData ( playerAccount, "Car1Price", price ) -- We can give him money back when he sell easyly takePlayerMoney ( source, price ) outputChatBox ( "Gratz! You have boughted "..carName.."! Price: "..price, source, 255, 0, 255 ) else outputChatBox ( "* ERROR: You dont have so much money! Needed: "..price.."!", source, 255,0,0 ) end else triggerClientEvent ( source, "showErrorOnCar1Buy", source ) -- > This will show you error, something like "Are you sure you wanan buy that car? You already have a car on that slot" ... end end addEvent ( "buyCar1", true ) addEventHandler ( "buyCar1", getRootElement(), buyCar1 ) -- For selling car function sellCar1 ( ) local playerAccount = getPlayerAccount ( source ) local car1 = getAccountData ( playerAccount, "Car1" ) if ( car1 ) then setAccountData ( playerAccount, "Car1", nil ) local price = getAccountData ( playerAccount, "Car1Price" ) outputChatBox ( "Gratz! You have sold "..car1.."! Obtained: "..price/2, source, 255, 0, 255 ) givePlayerMoney ( source, price/2 ) else triggerClientEvent ( source, "showErrorOnCar1Sell", source ) -- > This will show you error, when you sell car, like "Are you sure ?" .. end end addEvent ( "sellCar1", true ) addEventHandler ( "sellCar1", getRootElement(), sellCar1 ) Link to comment
will briggs Posted June 22, 2011 Share Posted June 22, 2011 May i comment by saying, do you really mean Sloth ? A sloth is an animal.... 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