SA-MP Forums Archive
Need help with teleports. - 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: Need help with teleports. (/showthread.php?tid=384198)



Need help with teleports. - Majava - 10.10.2012

I have working teleport dialog but what i need to do for getting it work with car?
small part

if(listitem == 0)
{
SetPlayerPos(playerid,1893.8665,-2328.5776,13.5469); //LS AIRPORT
}
else if(listitem == 1)
{
SetPlayerPos(playerid,-1530.5254,-78.3696,14.1484); // SF AIRPORT
}


Re: Need help with teleports. - Dolby - 10.10.2012

Код:
if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z);



Re: Need help with teleports. - [FAT]Klabauter[LST] - 10.10.2012

PHP код:
if(GetPlayerState(playerid) == 2
{
SetVehiclePos(GetPlayerVehicleID(playerid),1893.8665,-2328.5776,13.5469);

else

SetPlayerPos(playerid,1893.8665,-2328.5776,13.5469);

if you use any interiors make sure you add

PHP код:
LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(playerid)); 
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(playerid)); 
after you have set the player's interior and virtualworld


Re: Need help with teleports. - Majava - 10.10.2012

Player didn't stay in vehicle what i should do?


Re: Need help with teleports. - TzAkS. - 10.10.2012

https://sampwiki.blast.hk/wiki/Function:PutPlayerInVehicle


Re: Need help with teleports. - mastermax7777 - 10.10.2012

Quote:
Originally Posted by Gustavo_Araujo
Посмотреть сообщение
Код:
if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z);
this^^^^


Re: Need help with teleports. - Majava - 11.10.2012

PASTEBIN
Now its like this and not working. I am sorry i am scripting beginner.


Re: Need help with teleports. - denNorske - 11.10.2012

http://pastebin.com/RZTC6mC7

Check what i did.

If the server found out that the player was in a vehicle, it should do something, right? It should put the vehicle to the new position, okay?

"IF" player is in a vehicle, okay - do this:
Put the vehicle "here" (cordinates).
If the player is not in a vehicle, yes, then put the player "here".

see?

:P