Question. [Real Easy]
#1

So I got some coordinates, I want, when a player enters cordinate 1 to teleport to cordinate 2. How do I do that? Under which public?


( If players enters cordinate (-2088.0269,2477.8394,48.3979) then he should TP to (-2076.4126,2475.6736,41.1647). )
Reply
#2

pawn Код:
SetTimer("CheckPlayer",500,true);
Under OnGameModeInIt()
pawn Код:
forward CheckPlayer();
public CheckPlayer()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i,1,-2088.0269,2477.8394,48.3979))
            {
                SetPlayerPos(i,-2076.4126,2475.6736,41.1647);
            }
        }
    }
    return 1;
}
Somewhere in your script
Reply
#3

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 3.0, -2088.0269,2477.8394,48.3979))
{
    SetPlayerPos(playerid, -2076.4126,2475.6736,41.1647);
}
You need of the timer or checkpoint.
Reply
#4

You can use OnPlayerUpdate with IsPlayerInRangeOfPoint but it's better with Checkpoints
Reply
#5

Quote:
Originally Posted by AeroBlast
Посмотреть сообщение
pawn Код:
SetTimer("CheckPlayer",500,true);
Under OnGameModeInIt()
pawn Код:
forward CheckPlayer();
public CheckPlayer()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i,1,-2088.0269,2477.8394,48.3979))
            {
                SetPlayerPos(i,-2076.4126,2475.6736,41.1647);
            }
        }
    }
    return 1;
}
Somewhere in your script
Don't need a timer xD

This should work:
Quote:
Originally Posted by Josma_cmd
Посмотреть сообщение
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 3.0, -2088.0269,2477.8394,48.3979))
{
    SetPlayerPos(playerid, -2076.4126,2475.6736,41.1647);
}
You need of the timer or checkpoint.
Reply
#6

Or pickup.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)