Problem with PutPlayerInVehicle
#1

I'm trying to make it so when I do the command /work it teleports me to a certain area, and I want it to put me in a vehicle. My current work:

pawn Код:
COMMAND:work(playerid, cmdtext)
{
    SetPlayerPos(playerid, 817.0552, 857.0133, 12.7891);
    SendClientMessage(playerid, blue, "Welcome to work!");
    PutPlayerInVehicle(playerid, 498, 0);
    SetPlayerCheckpoint(playerid, -2666.7739,637.4879,14.4531, 4.0);
    return 1;
}
How come it's not putting me in that vehicle?
Reply
#2

Does the vehicle ID 498 exists?
VehicleID is not ModelID
Try this one:
pawn Код:
COMMAND:work(playerid, cmdtext)
{
    //SetPlayerPos(playerid, 817.0552, 857.0133, 12.7891); //Not needed v.
    SendClientMessage(playerid, blue, "Welcome to work!");
    new thevehicle = CreateVehicle(498, 817.0552, 857.0133, 14.7891, 0.0, 0, 0, 5000);
    PutPlayerInVehicle(playerid, thevehicle, 0);
    SetPlayerCheckpoint(playerid, -2666.7739,637.4879,14.4531, 4.0);
    return 1;
}
Reply
#3

Quote:
Originally Posted by Larceny
Посмотреть сообщение
Does the vehicle ID 498 exists?
VehicleID is not ModelID
Try this one:
pawn Код:
COMMAND:work(playerid, cmdtext)
{
    SetPlayerPos(playerid, 817.0552, 857.0133, 12.7891);
    SendClientMessage(playerid, blue, "Welcome to work!");
    new thevehicle = CreateVehicle(498, 817.0552, 857.0133, 12.7891, 0.0, 0, 0, 5000);
    PutPlayerInVehicle(playerid, thevehicle, 0);
    SetPlayerCheckpoint(playerid, -2666.7739,637.4879,14.4531, 4.0);
    return 1;
}
Oh, I must of had the model ID. I'll try a different one.
Reply
#4

Quote:
Originally Posted by Larceny
Посмотреть сообщение
Does the vehicle ID 498 exists?
VehicleID is not ModelID
Try this one:
pawn Код:
COMMAND:work(playerid, cmdtext)
{
    //SetPlayerPos(playerid, 817.0552, 857.0133, 12.7891); //Not needed v.
    SendClientMessage(playerid, blue, "Welcome to work!");
    new thevehicle = CreateVehicle(498, 817.0552, 857.0133, 14.7891, 0.0, 0, 0, 5000);
    PutPlayerInVehicle(playerid, thevehicle, 0);
    SetPlayerCheckpoint(playerid, -2666.7739,637.4879,14.4531, 4.0);
    return 1;
}
Yea, that works. But what is the 5000 for at
pawn Код:
new thevehicle = CreateVehicle(498, 817.0552, 857.0133, 14.7891, 0.0, 0, 0, 5000);
Reply
#5

Quote:

respawn_delay The delay until the car is respawned without a driver in seconds.

https://sampwiki.blast.hk/wiki/CreateVehicle
Reply
#6

Quote:
Originally Posted by Generation-X
Посмотреть сообщение
Yea, I just checked. Thanks.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)