autogate only work for id 0
#1

pawn Код:
forward onPlayerUpdateEx();
public onPlayerUpdateEx() //1 sec timer
{
    foreach(Player, playerid)
    {
        if(IsPlayerInRangeOfObject(playerid, Gate1, 20.0) || IsPlayerInRangeOfObject(playerid, Gate2, 20.0))
        {
            if(IsPlayerPolice(playerid))
            {
                MoveDynamicObject(Gate1, -1619.0000, 688.5200, 9.7574, 2.0);
                MoveDynamicObject(Gate2, -1644.3500, 688.5200, 9.7574, 2.0);
            }
        }
        else
        {
            MoveDynamicObject(Gate1, -1627.0886, 688.5200, 9.7574, 2.0);
            MoveDynamicObject(Gate2, -1635.9632, 688.5200, 9.7574, 2.0);
        }
    }
    return 1;
}
Reply
#2

OnPlayerUpdateEx(playerid);?

Then there's no need to use foreach or any type of loop.
Reply
#3

i cant add (playerid) if i use SetTimer, so i must use foreach to loop
Reply
#4

pawn Код:
SetTimerEx("onPlayerUpdateEx", 300, 1, "i", playerid);
Reply
#5

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
pawn Код:
SetTimerEx("onPlayerUpdateEx", 300, 1, "i", playerid);
that do the same with loop and SetTimer :3 anyway i fixed it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)