SA-MP Forums Archive
How do i create a vehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How do i create a vehicle (/showthread.php?tid=502977)



How do i create a vehicle - JoanB - 27.03.2014

Hey guys so i would like to ask how to create a vehicle somewhere in pawn like
there is
Quote:

addplayerclass and create object how can i make the vehicles




Re: How do i create a vehicle - SiraBots - 27.03.2014

Here's a command:

Код:
CMD:veh(playerid, params[])
{
	if(IsPlayerInAnyVehicle(playerid) || GetVehicleModelIDFromName(params[0]) == -1 ||
        GetVehicleModelIDFromName(params[0]) == 520) return true;
	new car, Float:a;
	GetPlayerFacingAngle(playerid, a);
	new Float:oldposx, Float:oldposy, Float:oldposz;
	GetPlayerPos(playerid, oldposx, oldposy, oldposz);
	car = CreateVehicle(GetVehicleModelIDFromName(params[0]),oldposx,oldposy,oldposz,0,0,0,-1);
	SetVehicleVirtualWorld(car, GetPlayerVirtualWorld(playerid));
	PutPlayerInVehicle(playerid,car,0);
	return 1;
}
https://sampwiki.blast.hk/wiki/CreateVehicle


Re: How do i create a vehicle - ChristianIvann09 - 27.03.2014

https://sampwiki.blast.hk/wiki/AddStaticVehicle

There you go

________________________
Did i helped you? Click on rep


Re: How do i create a vehicle - Equuuuin0X - 27.03.2014

@SiraBots, your command doesnt saves up the vehicles when you do a restart.

So, use SAMP or MTA map editor, map them, go to file .map for MTA mapper, then convert it to SAMP using convertffs.com then put the ''CreateVehicle'' or ''AddStaticVehicle'' or smth like that under ''GameModeInIt();"