Help Barrier Rotation Include
#1

Hi, well i've found this include that will allow barrier rotation(opening) and it works, but the problem is, when the barrier is going up when you press C or H(which is a key to start rotating) the timer will do something and the barrier will rotate in the other direction and by that you can rotate it 360°, and i've fixed that when it goes up by adding the variable that will block opening it untill the timer loads, but when it's rotating down and if i press H/C while rotation is in progress something happens with the timer and it rotates in the ground next time.



1: Include link: http://pastebin.com/GPACjJzJ

2. Opening barrier

pawn Код:
if(PRESSED(KEY_CROUCH))
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, 1544.7000000,-1630.9000000,13.1000000)) //PD
        {
            if(PI[playerid][Clan] == 1 && PDOtvorena == 0)
            {
                PDOtvorena = 1;
                ActivateRamp(rampapd, 2);
                SetTimerEx("PDRampa", 7000, false, "i", playerid);
            }
        }
    }
3. Timer for closing:

pawn Код:
public PDRampa()
{
    if(PDOtvorena == 1)
    {
        PDOtvorena = 0;
        ActivateRamp(rampapd, 1);
    }
    return 1;
}
Please help me idk what to do, thanks..
Reply
#2

I'd advise you against using that include since it is outdated to use it now, as it was outdated when SA-MP 0.3d was released.
Have a look at this thread here to see what's the "trick" to achieve smooth rotation and maybe even look in the included filterscript "ferriswheel.pwn" too see how it's done.
Then you can re-script your include to use the newest methods available.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)