MoeezKhan Posted February 3, 2014 Share Posted February 3, 2014 hi all anybody tell me how i make a car spawn panel which player buy car it can spawn it , lock/unlock,on/off engine,rent a car and set new owner please give me element. Link to comment
Karuzo Posted February 3, 2014 Share Posted February 3, 2014 What do you mean by 'give me element'? You can spawn cars by using createVehicle You can make a Panel by using guiCreateWindow-- and so on.. Rent a car and set new owner , to do this you have to save your owner's somewhere. Like XML, MySQL and so on. I think you should look for the community ressource just cause this is pretty difficult to do. Link to comment
MoeezKhan Posted February 5, 2014 Author Share Posted February 5, 2014 What do you mean by 'give me element'?You can spawn cars by using createVehicle You can make a Panel by using guiCreateWindow-- and so on.. Rent a car and set new owner , to do this you have to save your owner's somewhere. Like XML, MySQL and so on. I think you should look for the community ressource just cause this is pretty difficult to do. no i want which player buy car Link to comment
Gtagasje Posted February 5, 2014 Share Posted February 5, 2014 You seem like a just beginning scripter, and then I'd not recommend making such a system because if you want to do it good it'll take some scripting skills, but if you really want to try you can make a GUI using guiCreateWindow() Then you can add a gridlist with a vehicle, and make it trigger the buying when you click a button using guiCreateGridList() guiGridListGetSelectedItem() guiGridListGetItemText() guiCreateButton() onClientGUIClick -- On click event Then you can trigger a serverside event to create a vehicle using triggerServerEvent() And then you can spawn the vehicle, set it's owner and take the player's money using getPlayerMoney() takePlayerMoney() createVehicle() getAccountName() getPlayerAccount() setElementData() But, this is only part of the script, for example for the lock and engine you'd have to use setVehicleLocked() setVehicleEngineState() And to set a new owner you'd have to use setElementData() again. But as I said, this is only part of the script, if you want a good vehicle system it'd be a few hundred lines, and pretty advanced. (Speaking of experience, I just made one 2 weeks ago.) If you have a feeling you won't be able to do this, it's the best to just look for one on https://community.multitheftauto.com Link to comment
Anubhav Posted February 5, 2014 Share Posted February 5, 2014 As the gtagasje said. If you think gui is hard to make use GUI editor and else you can do. Theese are some functions u can make. createVehicle setElementData getElementData setVehicleLocked setVehicleEngineState guiCreateWindow guiCreateGridlist guiCreateButton guiGridilistAddRow guiGridlistAddColumn guiGridListGetSelectedItem guiGridListGetItemText addEventHandler addEvent getPlayerMoney takePlayerMoney getAccountName getPlayerAccount 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