SA-MP Forums Archive
Spawning with a car! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Spawning with a car! (/showthread.php?tid=243677)



Spawning with a car! - IvancheBG - 24.03.2011

When i go to example /ls and I am in a car i didnt spawn the car just me.How to spawn with a car?


Re: Spawning with a car! - sansko - 24.03.2011

just check if a player is in a vehicle and then teleport the car in that position and put the player inside it


Re: Spawning with a car! - IvancheBG - 24.03.2011

yes i am in a car but when i type /ls I am not with the car.


Re: Spawning with a car! - THE_KNOWN - 24.03.2011

use SetVehiclePos when you use SetPlayerPos too. or just get the vehicle id, tp the the vehicle to ls and PutPlayerInVehicle(playerid,vehicleid,0);


Re: Spawning with a car! - IvancheBG - 24.03.2011

I dont understand send a code or something please


Re: Spawning with a car! - THE_KNOWN - 24.03.2011

Код:
CMD:ls(playerid,params[])
{
	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
	    new veh=GetPlayerVehicleID;
	    SetVehiclePos(veh,x,y,z+2);//coords of the lsplace
	    PutPlayerInVehicle(playerid,veh,0);
	}
	else
	{
	    SetPlayerPos(playerid,x,y,z);
	}
	return 1;
}



Re: Spawning with a car! - sansko - 25.03.2011

before you do such complicated things,
start learning the basics
And RTFM


Re: Spawning with a car! - AK47317 - 25.03.2011

Quote:
Originally Posted by sansko
Посмотреть сообщение
And RTFM
what the heck is RTFM?


Re: Spawning with a car! - Mike Garber - 25.03.2011

pawn Код:
if(IsPlayerInAnyVehicle(playerid))
{
    SetVehiclePos(vehicleid,Float:x,Float:y,Float:z);
}
else
{
    SetPlayerPos(playerid,Float:x,Float:y,Float:z);
}
You don't have to use PutPlayerInVehicle or anything, if you move the vehicle the player in it wont get out of it.


Re: Spawning with a car! - IvancheBG - 25.03.2011

Where to put this?