SA-MP Forums Archive
Gates - 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: Gates (/showthread.php?tid=247410)



Gates - Ectazy - 09.04.2011

How do I do that the player came to a certain place and gates open?


Re: Gates - iJumbo - 09.04.2011

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint


Re: Gates - Ectazy - 09.04.2011

I tried, but no failed


Re: Gates - iJumbo - 09.04.2011

add me in msn pyrokar@libero.it i help u in live chat


Re: Gates - Sascha - 09.04.2011

pawn Код:
forward AreaCheck();

public OnGameModeInit()
{
    SetTimer("AreaCheck", 2000, true);
    return 1;
}

public AreaCheck()
{
    for(new i=0; i<GetMaxPlayers(); i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i, range, x, y, z)) //replace "range, x, y, z" with your object positions and the wished range
            {
                MoveObject(objectid, newx, newy, newz); //replace objectid, newx, newy, newz with your objectid and the new positions
            }
        }
    }
    return 1;
}