PDA

View Full Version : [GUIDE] How to map a car for Developers



Bani Raheja
29th June 2012, 09:43 AM
Well, Developers have a lot of work to do, so they dont have enough time for mapping cars and stuff. Here I bring a simple and easy tutorial , which will explain you how to map cars without even quitting the game and installing any extra applications.

It requires a simple command, /save

For example, you have donated some money to the server for custom cars and you want the car where you want, it will work like this..
Enter your car , and goto location where you want it to be spawned, like when you /park the car.
After that do this:
http://i45.tinypic.com/23rn2g2.jpg
This will save your car's position in GTA SA Userfiles > SAMP > savedpositions.txt
http://i49.tinypic.com/8vta4x.jpg
Open it and copy the AddStaticVehicle which has
//mycar(the name with which you saved the car position, here I saved it with mycar) at the end of its line
For example, I'll have this:
http://i49.tinypic.com/168c4uh.jpg
Since AddStaticVehicleEx has more functions than AddStaticVehicle, then will convert it to AddStaticVehicleEx
You can convert it here (www.convertffs.com)
Make sure that you have changed the Input and Output to this:
http://i49.tinypic.com/o6wh1k.jpg
You'll have the output like this:

AddStaticVehicleEx(451,1553.22960000,-1474.97800000,13.25470000,188.92730000,1,-1,15); //Turismo
There you go, you can give this to Developers


Why is AddStaticVehicleEx better than AddStaticVehicle?
Well AddStaticVehicleEx is better than AddStaticVehicle because with AddStaticVehicleEx, you can also customize the seconds after which the car will respawn after a user leaves the car....


Defination of AddStaticVehicleEx
You can use this function to add vehicles to your gamemode. This function can only create vehicles in the OnGameModeInit callback, and vehicles created with this function cannot be removed.
Basically, a normal AddStaticVehicleEx works like this:

AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2, respawn_delay);

modelid = The Model ID (http://wiki.sa-mp.com/wiki/Vehicle_Model_IDs) for the vehicle.
Float:spawn_X = The X-coordinate for the vehicle where it will spawn.
Float:spawn_Y = The Y-coordinate for the vehicle where it will spawn.
Float:spawn_Z = The Z-coordinate for the vehicle where it will spawn.
Float:angle = The facing - angle for the vehicle.
color1 = The primary color ID.(Make it -1 if you want it random on each spawn)
color2 = The secondary color ID.(Make it -1 if you want it random on each spawn)
respawn_delay = The delay until the car is respawned without a driver, in seconds.(Make it 900 for default)


I am lazy and I want to /save more than 1 cars but I am lazy to convert them all. What do I do?
Well, in this case, you can just simply add some units in X coordinate[horizontal coordinate] or Y coordinate[vertical coordinate] taking one AddStaticVehicleEx.
For example, you have only this :

AddStaticVehicleEx(451,1553.22960000,-1474.97800000,13.25470000,188.92730000,1,-1,15); //Turismo
and you want more cars to be spawned then you can just edit Model ID or X coordinate or Y Coordinate.
Lets take an example, I want to spawn 5 Turismos in one line[horizontally] and I have only one AddStaticVehicleEx, what will I do?
I will simple do this(observed underlined words)


AddStaticVehicleEx(451,1553.22960000,-1474.97800000,13.25470000,188.92730000,1,-1,15); //Turismo
AddStaticVehicleEx(451,1553.22960000+4,-1474.97800000,13.25470000,188.92730000,1,-1,15); //Turismo
AddStaticVehicleEx(451,1553.22960000+8,-1474.97800000,13.25470000,188.92730000,1,-1,15); //Turismo
AddStaticVehicleEx(451,1553.22960000+16,-1474.97800000,13.25470000,188.92730000,1,-1,15); //Turismo
AddStaticVehicleEx(451,1553.22960000+20,-1474.97800000,13.25470000,188.92730000,1,-1,15); //Turismo
AddStaticVehicleEx(451,1553.22960000+24,-1474.97800000,13.25470000,188.92730000,1,-1,15); //Turismo
You can clearly see that there's no difference in the different AddStaticVehicleEx(s) but only +4,+8 and +16. This will spawn the cars in one line at equal distances(I have used difference of 4 units only). This not only makes mapping cars easy but also neat. This is best option for lazy mappers/scripters like me :D

Cody
29th June 2012, 12:21 PM
Copied this off youtube!

Nice guide :D

Bani Raheja
29th June 2012, 01:09 PM
Oh Really? Tell me the link to it

Cody
29th June 2012, 08:33 PM
http://www.youtube.com/watch?v=uaJqFpBLH-4

Here's one for a start

Bani Raheja
30th June 2012, 08:21 AM
Lol its a complicated method on this link, using debug. Its my orignal lol

Ethan
13th July 2012, 01:48 AM
lol bani! but good tuto!

Che Guevara
13th July 2012, 03:24 AM
Good guide

Nick
13th July 2012, 03:37 AM
So, what's it for? I dont get it.

Jingle
2nd December 2012, 05:31 AM
Great Guide!

Jack
2nd December 2012, 05:57 AM
I think its made easier for the cordinates otherwise it would not help much..

Luke Shiels
2nd December 2012, 09:13 AM
Great Guide!

nice bump on an old thread, lolwtf - lost past 13th of July.

Panky
2nd December 2012, 09:36 AM
nice bump on an old thread, lolwtf - lost past 13th of July.

Anyways, this thread is pretty good for people who are new to the world of SAMP scripting and PAWNO.