PutPlayerInVehicle does nothing:'(
#1

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.
Reply
#2

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.
Reply
#3

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).
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)