how to make this teleport stock
#1

can any one tell me how can i make this stock teleport because this is very long command
pawn Код:
new gad = random(sizeof(gads));
  new cartype = GetPlayerVehicleID(playerid);
  new State = GetPlayerState(playerid);
  if(State!=PLAYER_STATE_DRIVER)
  {
  SetPlayerInterior(playerid,0);
  SetPlayerPos(playerid,gads[gad][0],gads[gad][1],gads[gad][2]+0.40);
  SetPlayerFacingAngle(playerid,gads[gad][3]);
  SetPlayerVirtualWorld(playerid,0);
  SetVehicleZAngle(cartype,gads[gad][3]);
  GameTextForPlayer(playerid,"~y~Telepoted To~n~Gads Airport!",5000,3);
  SetPlayerVirtualWorld(playerid,0);
  SetCameraBehindPlayer(playerid);
  }
  else if(IsPlayerInVehicle(playerid,cartype)== 1)
  {
  SetVehiclePos(cartype,gads[gad][0],gads[gad][1],gads[gad][2]+0.40);
  SetPlayerInterior(playerid,0 );
  SetPlayerVirtualWorld(playerid,0);
  SetVehicleZAngle(cartype,gads[gad][3]);
  GameTextForPlayer(playerid,"~y~Telepoted To~n~Gads Airport!",5000,3);
  SetPlayerVirtualWorld(playerid,0);
  SetCameraBehindPlayer(playerid);
  }
  else
  {
  SetPlayerPos(playerid,gads[gad][0],gads[gad][1],gads[gad][2]+0.40);
  SetPlayerFacingAngle(playerid,gads[gad][3]);
  SetPlayerInterior(playerid,0);
  SetPlayerVirtualWorld(playerid,0);
  SetPlayerVirtualWorld(playerid,0);
  SetCameraBehindPlayer(playerid);
  }
  return 1;
  }
help
Reply
#2

pawn Код:
stock TPMe(playerid)
{
new gad = random(sizeof(gads));
  new cartype = GetPlayerVehicleID(playerid);
  new State = GetPlayerState(playerid);
  if(State!=PLAYER_STATE_DRIVER)
  {
  SetPlayerInterior(playerid,0);
  SetPlayerPos(playerid,gads[gad][0],gads[gad][1],gads[gad][2]+0.40);
  SetPlayerFacingAngle(playerid,gads[gad][3]);
  SetPlayerVirtualWorld(playerid,0);
  SetVehicleZAngle(cartype,gads[gad][3]);
  GameTextForPlayer(playerid,"~y~Telepoted To~n~Gads Airport!",5000,3);
  SetPlayerVirtualWorld(playerid,0);
  SetCameraBehindPlayer(playerid);
  }
  else if(IsPlayerInVehicle(playerid,cartype)== 1)
  {
  SetVehiclePos(cartype,gads[gad][0],gads[gad][1],gads[gad][2]+0.40);
  SetPlayerInterior(playerid,0 );
  SetPlayerVirtualWorld(playerid,0);
  SetVehicleZAngle(cartype,gads[gad][3]);
  GameTextForPlayer(playerid,"~y~Telepoted To~n~Gads Airport!",5000,3);
  SetPlayerVirtualWorld(playerid,0);
  SetCameraBehindPlayer(playerid);
  }
  else
  {
  SetPlayerPos(playerid,gads[gad][0],gads[gad][1],gads[gad][2]+0.40);
  SetPlayerFacingAngle(playerid,gads[gad][3]);
  SetPlayerInterior(playerid,0);
  SetPlayerVirtualWorld(playerid,0);
  SetPlayerVirtualWorld(playerid,0);
  SetCameraBehindPlayer(playerid);
  }
  return 1;
  }
}
And you just need to call stock example:

pawn Код:
CMD:teleport(playerid,params[])
{
TPMe(playerid);
return 1;
}
Reply
#3

no this give another example....
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)