17.09.2009, 13:51
Hey man, see this code! This is a teleport command.
EDIT: You need to put this code under 'OnPlayerCommandText'.
Код:
if(strcmp("/ls-police", cmdtext, true, 10) == 0) // This is the command
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) // If somebody driving a vehicle, the vehicle teleported too.
{
SetPlayerInterior(playerid, 0);
LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
SetVehiclePos(GetPlayerVehicleID(playerid), 1545.638061, -1675.668701, 13.560752); // This is the position
SetVehicleZAngle(GetPlayerVehicleID(playerid), 92.046417);
return 1;
}
else // If not driving a vehicle (passanger, or on foot), this only set the player's position and don't teleport the vehicle.
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1545.638061, -1675.668701, 13.560752); // This is the position
SetPlayerFacingAngle(playerid, 92.046417);
return 1;
}
}

