04.08.2012, 21:49
Is there any way to prevent vehicle to stop, when someone teleports to it?
I tried with PutPlayerInVehicle and SetPlayerVelocity but if the player teleports to a car as a passenger, the car will be stopped (will not have the same velocity as before). Any ideas?
This is my code:
I tried with PutPlayerInVehicle and SetPlayerVelocity but if the player teleports to a car as a passenger, the car will be stopped (will not have the same velocity as before). Any ideas?
This is my code:
pawn Код:
Player[playerid][pVehicle] = CreateVehicle(ModelID,xPos,yPos,zPos + 1,Ang,VehicleColors[Color1],VehicleColors[Color2],0);
SetVehicleVirtualWorld(Player[playerid][pVehicle],Player[playerid][pWorld]);
PlayerPlaySound(playerid,1056,0,0,0);
new Count;
for(new PlayerNumber;PlayerNumber < MAX_PLAYERS;PlayerNumber++)
{
if(IsPlayerConnected(PlayerNumber))
{
if(PlayerNumber != playerid)
{
if(PlayersInVehicle[PlayerNumber] == TRUE)
{
if(VehicleSeats[ModelID - 400] > Count)
{
Count++;
PlayerPlaySound(PlayerNumber,1056,0,0,0);
PutPlayerInVehicle(PlayerNumber,Player[playerid][pVehicle],Count);
SetPlayerVelocity(PlayerNumber,xVel,yVel,zVel);
}
else
{
break;
}
}
}
}
}
PutPlayerInVehicle(playerid,Player[playerid][pVehicle],0);
SetPlayerVelocity(playerid,xVel,yVel,zVel);
SetVehicleVelocity(Player[playerid][pVehicle],xVel,yVel,zVel);