PutPlayerInVehicle
#1

i put /randcar and it suposed to put him in the car but it dosnt why?
Code:
if(strcmp(cmdtext,"/randcar",true)==0)
{
    new vModel;
    new r = random(3);
    if(r == 0) vModel = 415;
    else if(r == 1) vModel = 411;
    else vModel = 451;
    new Float:pPos[3];
    GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
    PutPlayerInVehicle(playerid, vModel, 0);
    return 1;
}
help meh out xD
__________________________
Dont ASK! me RolePlay questions
www.hazardboys.co.nr
Reply
#2

You have to create the vehicle first, you cant use the model id, you need the vehicle id.

https://sampwiki.blast.hk/wiki/CreateVehicle

You can use e.g. the players position for the coordinates.
Reply
#3

ok, i made this
Quote:

if(strcmp(cmdtext,"/randcar",true)==0)
{
new vModel;
new r = random(3);
if(r == 0) vModel = 415;
else if(r == 1) vModel = 411;
else vModel = 451;
new FloatPos[3];
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
CreateVehicle(vModel, pPos[0]+3, pPos[1], pPos[2], 0.0, -1, -1, -1);
PutPlayerInVehicle(playerid, vModel,0);
return 1;
}

it only creates the car in front of him -.- but it dosnt put him in it >.>
why?
Reply
#4

new Car;

CreateVehicle(..);

PutPlayerInVehicle(playerid, Car );
Reply
#5

You forgot the

car = CreateVehicle(..);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)