Help PLEASE
#9

Hey man, see this code! This is a teleport command.

Код:
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;
  }
}
EDIT: You need to put this code under 'OnPlayerCommandText'.
Reply


Messages In This Thread
Help PLEASE - by Joke(MK) - 16.09.2009, 14:18
Re: Help to put scripts - by AG Adam - 16.09.2009, 14:47
Re: Help to put scripts - by Joke(MK) - 16.09.2009, 14:53
Re: Help to put scripts - by Joke(MK) - 16.09.2009, 15:02
Re: Help to put scripts - by Imran.Abbas - 16.09.2009, 15:05
Re: Help to put scripts - by Joke(MK) - 16.09.2009, 15:32
Re: Help PLEASE - by AG Adam - 17.09.2009, 13:43
Re: Help PLEASE - by alistair_hawk - 17.09.2009, 13:46
Re: Help PLEASE - by AG Adam - 17.09.2009, 13:51

Forum Jump:


Users browsing this thread: 5 Guest(s)