PutPlayerInVehicle does nothing:'( - 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: PutPlayerInVehicle does nothing:'( (
/showthread.php?tid=464159)
PutPlayerInVehicle does nothing:'( -
Mennims - 15.09.2013
Soooooooo. I made a command, you type /vehicle (it's just temporary) and it is supposed to put you in a spawned infernus (411).
pawn Код:
PutPlayerInVehicle(playerid, 411, 0);
So I am guessing vehicleid is not what I think it is. Well in this case, I guess it is a unique number for a spawned car. So how would I find that number? Because that script does absolutely NoThInG.
Re: PutPlayerInVehicle does nothing:'( -
Konstantinos - 15.09.2013
The function works fine. It needs the vehicleid, not the modelid. 411 is the model of infernus.
For example, if you create a vehicle with a command, when you create it store the ID of it in a variable and then use the variable instead of the 411 you've written.
Re: PutPlayerInVehicle does nothing:'( -
Jstylezzz - 15.09.2013
pawn Код:
CMD:vehicle(playerid,params[])
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
new vehicle = CreateVehicle(411, x, y, z, 90, 0, 1, 60);
PutPlayerInVehicle(playerid,vehicle,0);
return 1;
}
This is one of the correct usages of the function. If you know the vehicleid, you can use it there too (like Konstantinos said, there's a difference between the
modelid and
vehicleid).
Re: PutPlayerInVehicle does nothing:'( -
Mennims - 15.09.2013
Ok, I will try that, whilst I was waiting I replaced 411 with a 1, and it spawned me in a car. The way I see you guys do it makes me wonder why 1 would make it spawn me in a vehicle.