SA-MP Forums Archive
Teleport Only Me And Not The 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: Teleport Only Me And Not The Car (/showthread.php?tid=91739)



Teleport Only Me And Not The Car - Smiths - 16.08.2009

I got this codes:
Код:
if(strcmp(cmdtext, "/bmx1", true) == 0)
	  {

			if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	    {
				SetPlayerPos(playerid, 1964.5905,1923.5120,130.9375);
	 			DestroyVehicle(GetPlayerVehicleID(playerid));
	 			LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
			}
	    else
	    {
	      DestroyVehicle(GetPlayerVehicleID(playerid));
	    	SetPlayerPos(playerid, 1964.5905,1923.5120,130.9375);
	    }
			GameTextForPlayer(playerid, ".:::::BMX 1:::::.",1500,5);
			SendClientMessage(playerid, COLOR_YELLOW, "TELEPORTED TO /BMX1 .");
			TogglePlayerControllable(playerid, 1);
	 		SetPlayerInterior(playerid, 0);
			ResetPlayerWeapons(playerid);
			return 1;
	  }
It work but the car doesn't spawn back....... I need to restart my server to repawn the vehicle....
Sorry for my english



Re: Teleport Only Me And Not The Car - XtremeChio - 16.08.2009

Try adding your vehicle with AddStaticVehicleEx - It respawns them, and you choose when https://sampwiki.blast.hk/wiki/AddStaticVehicleEx


Re: Teleport Only Me And Not The Car - Luca Dimonte - 16.08.2009

If you destroy the vehicles, they won't respawn. Use SetVehicleToRespawn to force the respawning.


Re: Teleport Only Me And Not The Car - Smiths - 16.08.2009

how do i that with SetVehicleToRespawn?


Re: Teleport Only Me And Not The Car - XtremeChio - 16.08.2009

Quote:
Originally Posted by Smiths
how do i that with SetVehicleToRespawn?
Have you tried the AddStaticVehicleEx ? It should do the job :P


Re: Teleport Only Me And Not The Car - Smiths - 16.08.2009

Im using this....
CreateVehicle(481,1966.2937,1917.5670,130.4553,29. 8565,0,0, 10); //

So i only change CreateVehicle to AddStaticVehicleEx


Re: Teleport Only Me And Not The Car - XtremeChio - 16.08.2009

Try changing the delay to 60, tho it's not the fix lol.

Strange..It should work. But try with the 60 seconds and then AddStaticVehicleEx, yes you just replace the name.


Re: Teleport Only Me And Not The Car - Smiths - 16.08.2009

It doesn't work... it do the same thing.... It delete the vehicle but it doesn't spawn back!

is there any code who do the same thing like DestroyVehicle(GetPlayerVehicleID(playerid)); ??


Re: Teleport Only Me And Not The Car - Jefff - 16.08.2009

Код:
if(strcmp(cmdtext, "/bmx1", true) == 0)
{
	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		RemovePlayerFromVehicle(playerid); // or delete this line if dont works
		SetVehicleToRespawn(GetPlayerVehicleID(playerid));
		LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
		SetPlayerPos(playerid, 1964.5905,1923.5120,130.9375);
	}else{
		SetPlayerPos(playerid, 1964.5905,1923.5120,130.9375);
	}
	GameTextForPlayer(playerid, ".:::::BMX 1:::::.",1500,5);
	SendClientMessage(playerid, COLOR_YELLOW, "TELEPORTED TO /BMX1 .");
	TogglePlayerControllable(playerid, 1);
	SetPlayerInterior(playerid, 0);
	ResetPlayerWeapons(playerid);
	return 1;
}



Re: Teleport Only Me And Not The Car - Jakku - 16.08.2009

DestroyVehicle doesn't respawn the vehicle. Use SetVehicleToRespawn. https://sampwiki.blast.hk/wiki/SetVehicleToRespawn