[Tutorial] How to create your own vehicle system
#21

Oops, I totally forgot about this tutorial, just got reminded by someone who PMed me about it

@Dirkon: The error is caused by a stupid mistake i made.
stock CreateVehicleEx(modelid, Float: x, Float:y, Float:z, Float:angle, color1, color2, respawntime, ownername[20])
has to be
stock CreateVehicleEx(modelid, Float: x, Float:y, Float:z, Float:angle, color1, color2, respawntime, ownername[MAX_PLAYER_NAME])
of course, and the array size of owner in carDataEnum has to be MAX_PLAYER_NAME too. (I also updated the first post now)

@bijoyekuza: The owner is what you set in CreateVehicleEx, and you can simply get it with carData[vehicleid][owner]. The code you made should do it.
For a /park command just change the x/y/zspawn coordinates for carData[vehicleid], as well as the rotation of it (anglespawn) and add this to the top of your OnVehicleSpawn callback:
pawn Code:
SetVehiclePos(vehicleid, carData[vehicleid][xspawn], carData[vehicleid][yspawn], carData[vehicleid][zspawn]);
// This will teleport the vehicle to its updated spawn position on spawn
SetVehicleZAngle(vehicleid, carData[vehicleid][anglespawn]);
// and sets it rotation to the stored spawn angle.
Reply


Messages In This Thread
How to create your own vehicle system - by Mauzen - 26.11.2010, 13:41
Re: How to create your own vehicle system - by WillyP - 26.11.2010, 15:09
Re: How to create your own vehicle system - by dark_clown - 26.11.2010, 15:13
Re: How to create your own vehicle system - by Anthonyx3' - 26.11.2010, 15:51
Re: How to create your own vehicle system - by HyperZ - 26.11.2010, 16:40
Re: How to create your own vehicle system - by black_dota - 27.11.2010, 00:50
Re: How to create your own vehicle system - by Haydz - 27.11.2010, 04:22
Re: How to create your own vehicle system - by StreetGT - 27.11.2010, 13:50
Re: How to create your own vehicle system - by Guest3598475934857938411 - 30.11.2010, 21:40
Re: How to create your own vehicle system - by SkizzoTrick - 01.01.2011, 19:37
Re: How to create your own vehicle system - by jameskmonger - 01.01.2011, 19:45
Re: How to create your own vehicle system - by SkizzoTrick - 01.01.2011, 20:09
Re: How to create your own vehicle system - by SkizzoTrick - 01.01.2011, 20:19
Re: How to create your own vehicle system - by Marty_Alex - 02.01.2011, 10:00
Re: How to create your own vehicle system - by Omecken - 13.01.2011, 09:55
Re: How to create your own vehicle system - by Parrot - 14.01.2011, 09:26
Re: How to create your own vehicle system - by Swiftz - 17.01.2011, 11:24
Re: How to create your own vehicle system - by Robbie_Jay - 17.01.2011, 11:45
Re: How to create your own vehicle system - by bijoyekuza - 01.06.2011, 13:05
Re: How to create your own vehicle system - by Dirkon - 05.07.2011, 19:05
Re: How to create your own vehicle system - by Mauzen - 06.07.2011, 13:30
Re: How to create your own vehicle system - by Dirkon - 06.07.2011, 18:06
Re: How to create your own vehicle system - by Mauzen - 06.07.2011, 21:58
Re: How to create your own vehicle system - by Dirkon - 07.07.2011, 14:57
Re: How to create your own vehicle system - by kadaradam - 13.07.2011, 10:49
Re : How to create your own vehicle system - by Varkoll_ - 17.07.2011, 10:30
Re: How to create your own vehicle system - by Buzzbomb - 11.10.2011, 02:03
Re: How to create your own vehicle system - by Shooter3 - 11.10.2011, 10:01
Re: How to create your own vehicle system - by robintjeh - 14.10.2011, 18:22
Re: How to create your own vehicle system - by Henkie - 17.10.2011, 17:15
Re: How to create your own vehicle system - by Buzzbomb - 25.10.2011, 03:41
Re: How to create your own vehicle system - by Mauzen - 06.01.2012, 20:16
Re: How to create your own vehicle system - by Marshall32 - 12.02.2012, 12:42
Re: How to create your own vehicle system - by Ajvanho - 22.08.2014, 22:26
Re: How to create your own vehicle system - by TeddyYeah - 04.09.2014, 09:06
Re: How to create your own vehicle system - by FlipperK119 - 04.09.2014, 09:11

Forum Jump:


Users browsing this thread: 1 Guest(s)