Return To The First Position
#1

Hi Guys,
I Want To Know How to Tele Any another Position And If I typed "/Exit" I Return To The First Position

For Example:
I am Now In The Airport
And I Want To Tele TDM And IF I Want To Exit I Type /Exit And Back To The Airport

Sorry For My Verrry Bad English
Reply
#2

Save your position in a variable before you teleport.
Reply
#3

At the /enter store your own position. And set them back when you type /exit.
Reply
#4

@ Kingunit
Sry My English Is Bad I Don't Understand What U Mean...
Reply
#5

As Kingunit said, you can save position and then load it.
pawn Код:
//At The Top
new Float: X_P[MAX_PLAYERS], Float:Y_P[MAX_PLAYERS], Float: Z_P[MAX_PLAYERS];

CMD:enter(playerid, params[])
{
    GetPlayerPos(playerid, X_P[playerid],Y_P[playerid],Z_P[playerid]);
    SendClientMessage(playerid,COLOR_GREEN,"Position saved!");
    return 1;
}

CMD:exit(playerid, params[])
{
    if (GetPlayerState(playerid)==PLAYER_STATE_DRIVER)SetVehiclePos(GetPlayerVehicleID(playerid), X_P[playerid],Y_P[playerid],Z_P[playerid]);
    else SetPlayerPos(playerid, X_P[playerid],Y_P[playerid],Z_P[playerid]);
    ResetPlayerWeapons(playerid);
    SendClientMessage(playerid,COLOR_GREEN,"Position loaded!");
    return 1;
}
Reply
#6

Thnx
Reply
#7

No Problem
Reply
#8

Nervermind.
Reply
#9

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Try something like:

pawn Код:
//AT THE TOP
new Float:posX, Float:posY, Float:posZ, Float:facingA;
 
//ON ENTER
GetPlayerPos(playerid, posX, posY, posZ);
GetPlayerFacingAngle(playerid, facingA);

//ON EXIT
SetPlayerPos(playerid, posX, posY, posZ);
SetPlayerFacingAngle(playerid, facingA);
Too slow.
Better to get GetPlayerState, may he wants to teleport to his saved position with vehicle.
Reply
#10

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
Better to get GetPlayerState, may he wants to teleport to his saved position with vehicle.
Thanks for the heads up, but there's no point now.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)