Help with gate(keypad)..
#1

So im making a gate to open it with keypad i follow one tutorial i have saved it but i dont know which was.. But not working can anyone help me whats wrong?? I go in game and go to the keypad click on "Enter or F" btw not opening


So here is:
pawn Код:
new swatv1;
pawn Код:
forward swatv1zatvori();
pawn Код:
public swatv1zatvori()
{
    MoveDynamicObject(swatv1,2720.23461914,-2403.98461914,15.23432922, 2.00);
    return 1;
}
pawn Код:
swatv1 = CreateDynamicObject(980,2720.23461914,-2403.98461914,15.23432922,0.00000000,0.00000000,270.00000000); //object(airportgate) (1)
OnPlayerKeyStateChange:
pawn Код:
if(newkeys & 16)
        {
            if(IsPlayerInRangeOfPoint(playerid, 3.0, 2719.97509766,-2410.55859375,13.85989571))
            {
                if (PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
                {
                    MoveDynamicObject(swatv1,2720.23461914,-2403.98461914,9.48432922,2.0);
                    SetTimerEx("swatv1zatvori", 5000, false, "i", playerid);
                    ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0);
                }
            }
        }

Added and keypad:
pawn Код:
CreateDynamicObject(2922,2719.97509766,-2410.55859375,13.85989571,0.00000000,0.00000000,88.00000000); //Swat Door 1 Keypad
Reply
#2

check whether the range is ok.. maybe the altitude of it doesn't fit into the range..
try to debug it..
like that:
pawn Код:
if(newkeys & 16)
        {
            print("You've pressed Key 16");
            if(IsPlayerInRangeOfPoint(playerid, 3.0, 2719.97509766,-2410.55859375,13.85989571))
            {
                if (PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
                {
                    print("You are in range of the point");
                    MoveDynamicObject(swatv1,2720.23461914,-2403.98461914,9.48432922,2.0);
                    SetTimerEx("swatv1zatvori", 5000, false, "i", playerid);
                    ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0);
                }
            }
        }
so you know whether it even gets if you pressed the key to limit the width of where the mistake could be / what could cause it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)