OrbTanT Posted August 3, 2014 Posted August 3, 2014 How can I create a vehicle using the ID of the same, I am using this script, the more they create using the name. function createVehicleCommand ( thePlayer, commandName, carName ) local carModel = getVehicleModelFromName ( carName ) local x, y, z = getElementPosition ( thePlayer ) if not carModel then outputChatBox ( "That is not a valid car name" ) else createVehicle ( carModel, x + 5, y, z ) outputChatBox ( "A vehicle with model ID of " .. carModel .. " was created!" ) end end addCommandHandler ( "vehicle", createVehicleCommand )
TAPL Posted August 3, 2014 Posted August 3, 2014 I didn't understand what you mean, try to explain better?
DNL291 Posted August 3, 2014 Posted August 3, 2014 He wants to create a vehicle by ID and not by the name. Shinigami, try this: function createVehicleCommand ( thePlayer, commandName, vehID ) if not getVehicleNameFromModel(vehID) then outputChatBox ( "That is not a valid vehicle ID" ) else local x, y, z = getElementPosition ( thePlayer ) createVehicle ( tonumber(vehID), x + 5, y, z ) outputChatBox ( "A vehicle with model ID of " .. vehID .. " was created!" ) end end addCommandHandler ( "vehicle", createVehicleCommand ) Please do not PM me with scripting related question nor support, use the forums instead.
Max+ Posted August 3, 2014 Posted August 3, 2014 I didn't understand what you mean, try to explain better? i think he want to type command to create vehicle and check if the vehicle is valid or not - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
OrbTanT Posted August 3, 2014 Author Posted August 3, 2014 Thank you Max, is exactly what I wanted to create a vehicle for the ID, and thank you to all who helped
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