08.09.2013, 16:38
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.
|
Use the SetVehiclePos function. Then use the SetPlayerPos function. Then use the PutPlayerInVehicle function
|
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;
}
|
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? |
)
|
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;
}
error 017: undefined symbol "vehicleid" error 017: undefined symbol "vehicleid" How do I make it so I can use vehicleid inside of the command? |
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;
}