SA-MP Forums Archive
Enter interior with F bug - 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)
+--- Thread: Enter interior with F bug (/showthread.php?tid=527824)



Enter interior with F bug - DTV - 24.07.2014

I've got it working that when I hit F, it does enter, but SPACE also makes it enter.

pawn Код:
if((newkeys && KEY_SECONDARY_ATTACK))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3, -290.9612, 2499.0200, 37.6646))//Asylum Enter
        {
            TogglePlayerControllable(playerid, 0);
            SetPlayerPos(playerid, -737.5634, 2820.1011, 996.6751);
            SetPlayerFacingAngle(playerid, -89.7083);
            SetTimerEx("LoginDelay", 3000, false, "i", playerid);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3, -737.5634, 2820.1011, 996.6751))//Asylum Exit
        {
            TogglePlayerControllable(playerid, 0);
            SetPlayerPos(playerid, -290.9612, 2499.0200, 37.6646);
            SetPlayerFacingAngle(playerid, -5.3974);
            SetTimerEx("LoginDelay", 3000, false, "i", playerid);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3, -735.2418, 2801.9180, 998.4583))//Asylum Master Room Enter
        {
            TogglePlayerControllable(playerid, 0);
            SetPlayerPos(playerid, 15.3560, 2221.6936, 992.5586);
            SetPlayerFacingAngle(playerid, 1.4725);
            SetTimerEx("LoginDelay", 3000, false, "i", playerid);
        }
        if(IsPlayerInRangeOfPoint(playerid, 3, 15.3560, 2221.6936, 992.5586))//Asylum Master Room Exit
        {
            TogglePlayerControllable(playerid, 0);
            SetPlayerPos(playerid, -735.2418, 2801.9180, 998.4583);
            SetPlayerFacingAngle(playerid, -39.2612);
            SetTimerEx("LoginDelay", 3000, false, "i", playerid);
        }
    }
I tried with the "&& !(oldkeys && KEY_SECONDARY_ATTACK)" and that didn't help either.


Respuesta: Enter interior with F bug - SickAttack - 24.07.2014

pawn Код:
#define HOLDING(%0)   ((newkeys & (%0)) == (%0))
#define PRESSED(%0)   (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define RELEASED(%0)   (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))

if(PRESSED(KEY_SECONDARY_ATTACK))



Re: Enter interior with F bug - DTV - 24.07.2014

That worked, thanks!