Problem with PutPlayerInVehicle - 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: Problem with PutPlayerInVehicle (
/showthread.php?tid=282460)
Problem with PutPlayerInVehicle -
rangerxxll - 11.09.2011
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?
Re: Problem with PutPlayerInVehicle -
Shelby - 11.09.2011
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;
}
Re: Problem with PutPlayerInVehicle -
rangerxxll - 11.09.2011
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.
Re: Problem with PutPlayerInVehicle -
rangerxxll - 11.09.2011
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);
Re: Problem with PutPlayerInVehicle -
Generation-X - 11.09.2011
Quote:
respawn_delay The delay until the car is respawned without a driver in seconds.
|
https://sampwiki.blast.hk/wiki/CreateVehicle
Re: Problem with PutPlayerInVehicle -
rangerxxll - 11.09.2011
Quote:
Originally Posted by Generation-X
|
Yea, I just checked. Thanks.