SA-MP Forums Archive
How do I make a player teleport into random cars? - 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: How do I make a player teleport into random cars? (/showthread.php?tid=238584)



How do I make a player teleport into random cars? - grand.Theft.Otto - 12.03.2011

I have a /kartdm command which teleports a player on top of the four dragons casino and I want the players to teleport into the car right away when they do /kartdm, so they can proceed with driveby dming.

I have the coordinates but I just don't know how to set it up.


Re: How do I make a player teleport into random cars? - Tommy_Mandaz - 12.03.2011

Well a combination of this:

Код:
CreateVehicle(carid, X,Y,Z,A, color1, color2, respawn delay);
and

Код:
PutPlayerInVehicle(playerid,vehicleid,seatid);
To make the person go into a go cart do this:

First this:

Код:
CreateVehicle(571, X,Y,Z,A, 0, 0, -1)
-Creates the gokart

Then this:

Код:
PutPlayerInVehicle(playerid,571,0);
-Puts the player into the drivers seat of the gokart

Of coarse you add these to your command


Re: How do I make a player teleport into random cars? - grand.Theft.Otto - 12.03.2011

Yes, but I need it to teleport to random karts when I type the command.


Re: How do I make a player teleport into random cars? - Tommy_Mandaz - 12.03.2011

You can create some karts with AddStaticVehicleEx() then use the SetPlayerPos() to teleport the players to the karts... And so on.