SA-MP Forums Archive
How i can put player in vehicle? - 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: How i can put player in vehicle? (/showthread.php?tid=388964)



How i can put player in vehicle? - SkyWings - 31.10.2012

Hey,

how i can put player in vehicle?

Code:

Код:
PutPlayerInVehicle(playerid, 462, 0);
PutPlayerInVehicle(DuelID, 462, 0);
Didn't working :/


Re: How i can put player in vehicle? - Kevin FOx - 31.10.2012

Show me the command..


Re: How i can put player in vehicle? - Simon - 31.10.2012

It appears that you are trying to use 'model id' rather than 'vehicle id'. Vehicle id is a unique ID which indentifies an "instance" of a vehicle (can have multiple vehicles with the same model id). Model id is the ID which describes how a vehicle looks (e.g. Faggio has model id 462)

You can get the vehicle id of a vehicle by getting the return value of CreateVehicle/AddStaticVehicle(Ex). Something like this:

pawn Код:
// global variables
new my_vehicle_id;
new my_other_vehicle_id;

// when you create the vehicle save their vehicleid's
my_vehicle_id = CreateVehicle(...);
my_other_vehicle_id = AddStaticVehicle(...);

// at some point when you want to put the player in your
// created vehicles
PutPlayerInVehicle(playerid, my_vehicle_id, 0);
PutPlayerInVehicle(playerid, my_other_vehicle_id, 0);
There are also other ways to get the vehicle id such as OnPlayerEnterVehicle.


Re: How i can put player in vehicle? - SkyWings - 31.10.2012

--Deleted--