How do I keep a player inside a vehicle when setplayerpos - 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: How do I keep a player inside a vehicle when setplayerpos (
/showthread.php?tid=462798)
How do I keep a player inside a vehicle when setplayerpos -
ExtendedCarbon - 08.09.2013
I have some teleport commands set up, but when I use the command only my player teleports and the car stays where I used the command. I need some help on bringing the car and keeping the player inside.
Re: How do I keep a player inside a vehicle when setplayerpos -
[HK]Ryder[AN] - 08.09.2013
Use the
SetVehiclePos function. Then use the SetPlayerPos function. Then use the
PutPlayerInVehicle function
Re: How do I keep a player inside a vehicle when setplayerpos -
ExtendedCarbon - 08.09.2013
Quote:
Originally Posted by [HK]Ryder[AN]
|
I've got
Код:
COMMAND:lv(playerid, params[])
{
SetVehiclePos(vehicleid, 2005.7919,1544.5870,13.5042)
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, 2005.7919,1544.5870,13.5042);
PutPlayerInVehicle(playerid, vehicleid, 0);
SendClientMessage(playerid, COLOR_YELLOW, "You have teleported to: Las Venturas");
return 1;
}
But I'm getting an error:
error 017: undefined symbol "vehicleid"
error 017: undefined symbol "vehicleid"
How do I make it so I can use vehicleid inside of the command?
Re: How do I keep a player inside a vehicle when setplayerpos -
Fierro - 08.09.2013
Quote:
Originally Posted by ExtendedCarbon
I've got
...
But I'm getting an error:
error 017: undefined symbol "vehicleid"
error 017: undefined symbol "vehicleid"
How do I make it so I can use vehicleid inside of the command?
|
The problem here is that you have not defined vehicleid in range of that function. You're going to need that vehicleid variable inside the command's function. (Hint:
https://sampwiki.blast.hk/wiki/GetPlayerVehicleID 
)
Re: How do I keep a player inside a vehicle when setplayerpos -
Ceez - 08.09.2013
Quote:
Originally Posted by ExtendedCarbon
I've got
Код:
COMMAND:lv(playerid, params[])
{
SetVehiclePos(vehicleid, 2005.7919,1544.5870,13.5042)
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid, 2005.7919,1544.5870,13.5042);
PutPlayerInVehicle(playerid, vehicleid, 0);
SendClientMessage(playerid, COLOR_YELLOW, "You have teleported to: Las Venturas");
return 1;
}
But I'm getting an error:
error 017: undefined symbol "vehicleid"
error 017: undefined symbol "vehicleid"
How do I make it so I can use vehicleid inside of the command?
|
Use the following code:
Код:
COMMAND:lv(playerid, params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid))
{
SetPlayerPos(playerid, 2005.7919,1544.5870,13.5042);
}
else
{
SetVehiclePos(vehicleid, 2005.7919,1544.5870,13.5042)
}
SetPlayerVirtualWorld(playerid, 0);
SendClientMessage(playerid, COLOR_YELLOW, "You have teleported to: Las Venturas");
return 1;
}
+REP if I helped