SA-MP Forums Archive
Teleport help - 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: Teleport help (/showthread.php?tid=337365)



Teleport help - nogh445 - 26.04.2012

So I made a boxed off area with cars inside of it. I want to be able to teleport out of the boxed area with the car. Can anybody help?


Re: Teleport help - RollTi - 26.04.2012

pawn Код:
if(IsPlayerInAnyVehicle(playerid)) //checks if player is in any vehicle
{
   SetVehiclePos(GetPlayerVehicleID(playerid), CoordX, CoordY, CoordZ);
}
else //else if player is not in any vehicle
{
   SetPlayerPos(playerid, CoordX, CoordY, CoordZ);
}
EDIT:

Quote:
Originally Posted by WarriorEd22
Посмотреть сообщение
Make a checkpoint where if you go into that checkpoint with you vehicle, you will automatically teleport to your desired location while you're still in your vehicle.
He asked how to teleport with vehicle i gave an example above

pawn Код:
if(IsPlayerInAnyVehicle(playerid)) //checks if player is in any vehicle
{
   SetVehiclePos(GetPlayerVehicleID(playerid), CoordX, CoordY, CoordZ);
}
else //else if player is not in any vehicle
{
   SetPlayerPos(playerid, CoordX, CoordY, CoordZ);
}



Re: Teleport help - WarriorEd22 - 26.04.2012

Make a checkpoint where if you go into that checkpoint with you vehicle, you will automatically teleport to your desired location while you're still in your vehicle.


Re: Teleport help - .FuneraL. - 26.04.2012

Create one Pickup :

Top of Script


pawn Код:
new Pickup;

OnPlayerPickUpPickup:


pawn Код:
public OnPlayerPickUpPickup(playerid,pickupid);
{
    if(pickupid == Pickup) SetPlayerPos(playerid, "Coordinates"), SetPlayerInterior(playerid, 0);
    return 1;
}
OnGameModeInit

pawn Код:
Pickup = CreatePickup(ID, 1, "Coordinates", -1);
Only One Example.Work out with your contact details now