SA-MP Forums Archive
How to put the player in what car I want? - 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 to put the player in what car I want? (/showthread.php?tid=88815)



How to put the player in what car I want? - krawN - 28.07.2009

Hi.

I've tried to do it using PutPlayerInVehicle but it doesn't works.

Quote:

PutPlayerInVehicle(playerid, 0, 0);

Is there anyone who can help me? Thx


Re: How to put the player in what car I want? - Correlli - 29.07.2009

Quote:
Originally Posted by krawN
I've tried to do it using PutPlayerInVehicle but it doesn't works.
It does.


Re: How to put the player in what car I want? - Daren_Jacobson - 29.07.2009

change the first 0 to the carid you want to put them in.


Re: How to put the player in what car I want? - agusfn20 - 29.07.2009

You can do..

pawn Код:
if(strcmp("/mycommand", cmdtext, true, 8) == 0)
    {
      if(IsPlayerInAnyVehicle(playerid))
      {
        new Float:X, Float:Y, Float:Z, Float:A;
        GetPlayerPos(playerid, X, Y, Z);
        GetPlayerFacingAngle(playerid, A);
        new MyVehicle = AddStaticVehicle(VehicleID, X, Y, Z, A, 0, 0);
        PutPlayerInVehicle(playerid, MyVehicle, 0);
        }else{
        SendClientMessage(playerid,0xAA3333AA, "You are already using a vehicle!");
        }
        return 1;
    }
In "VehicleID" you have to put the id of the vehicle you want to seat in.

pd: Not Tested