SA-MP Forums Archive
Help :S - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help :S (/showthread.php?tid=190562)



Help :S - <Weponz> - 15.11.2010

How can i make a teleport when someone walks into a area,Like IsPlayerInArea & SetPlayerPos but where do put the functions for it to work :S ?


I just need them to be teleported once thay walk into a area,No commands :S

Please help


Re: Help :S - Cameltoe - 15.11.2010

Timer probably.


Re: Help :S - <Weponz> - 15.11.2010

Quote:
Originally Posted by Cameltoe
Посмотреть сообщение
Timer probably.
Timer?

This is wat i exactly want,When thay walk to bank door thay tele inside,When thay walk to door inside it teles out side...Where can i place the functions? Do i got to make a unique callback or something xD


Re: Help :S - Cameltoe - 15.11.2010

Quote:
Originally Posted by <Weponz>
Посмотреть сообщение
Timer?

This is wat i exactly want,When thay walk to bank door thay tele inside,When thay walk to door inside it teles out side...Where can i place the functions? Do i got to make a unique callback or something xD
pawn Код:
new TeleTimer[MAX_PLAYERS];

// OnPlayerConnect
TeleTimer[playerid] = SetTimerEx("PosUpdate", true, 2000, "i", playerid);

// OnPlayerDC
KillTimer(TeleTimer[playerid]);
Next, make an callback that checks the playerpoint. IsPlayerInRange is recommended.


Re: Help :S - <Weponz> - 15.11.2010

Can u please give me the full code i need :S im lost :S


Re: Help :S - 6d - 15.11.2010

THIS should help.
Now, we all thank you for your very professional title, as "Help :S" ovbiously tells us you want to make a teleport so that when someone walks into the area it teleports them.
Maybe a more professional title would be "Teleporting by Area".
But okay. I Guess. I will give you a little boost:

pawn Код:
public Check()
{
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerInRangeOfPoint(i, 2/*this is the range*/, x, y, z/*Coordinates here*/))
        {
            SetPlayerInterior(playerid, /*the interior you want*/);
            SetPlayerPos(playerid, /*Coordinates you want*/);
        }
    }
    return 1;
}

public OnGameModeInit()
{
    SetTimer("Check", 1000, true);
    return 1;
}
Good Day,

6d


Respuesta: Help :S - AnGeeeL - 15.11.2010

pawn Код:
public Check()
{
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerInRangeOfPoint(i, 2/*this is the range*/, x, y, z/*Coordinates here*/))
        {
            SetPlayerInterior(playerid, /*the interior you want*/);
            SetPlayerPos(playerid, /*Coordinates you want*/);
        }
    }
    return 1;
}

public OnGameModeInit()
{
    SetTimer("Check", 1000, true);
    return 1;
}