SA-MP Forums Archive
automatic pickup 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: automatic pickup gates (/showthread.php?tid=263290)



automatic pickup gates - krisis32 - 21.06.2011

Why this gate code sorta lag. If i enter icon... and then re-enter it after gates are closed.. the gates starts to move... but in middle stops and fast goes back. It works perfect only 1 time. Then like i said.. move till middle of opening and fast goes back.
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == openjgin)
    {
    SetTimerEx("openjgintimer", 5000, true, "i", playerid);
   SendClientMessage(playerid,COLOR_GOLD,"You have 5 seconds to get out!");
    MoveStreamObject(jailgate,-345.25119018555, 1741.0574951172, 41.6875,3); // Opening gates
    
    }
    return 1;
}

forward openjgintimer(playerid);
public openjgintimer(playerid)
{
     if(IsPlayerConnected(playerid))
     {
     MoveStreamObject(jailgate,-344.23748779297, 1732.3273925781, 41.6875,1); // Closing gates
     }
     return 1;
}



Re: automatic pickup gates - Wesley221 - 21.06.2011

pawn Код:
SetTimerEx("openjgintimer", 5000, true, "i", playerid);
You're repeating the timer, or kill the timer, or change "true" to "false"


Re: automatic pickup gates - krisis32 - 21.06.2011

thanks, changing to 'false' worked out!