SA-MP Forums Archive
Command not working - 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: Command not working (/showthread.php?tid=256592)



Command not working - DDodo - 21.05.2011

pawn Код:
if(IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys)) {
        if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 2) {
            if(IsPlayerInRangeOfPoint(playerid, 4.5, 371.9613,166.6872,1008.3828)) switch(CHDoor) {
                case 0: {
                    MoveDynamicObject(CHDoor, 371.2587890625, 166.46171569824, 1007.3776245117, 3.5);
                    CHDoor = 1;
                }
                case 1: {
                    MoveDynamicObject(CHDoor, 371.25970458984, 166.59274291992, 1007.3776245117, 3.5);
                    CHDoor = 0;
                }
            }
        }
}
What's wrong with the code? Nothing happens when I press the SECONDARY ATTACK key...

It compiles with no errors / warnings.


Re: Command not working - Raimis_R - 21.05.2011

Change your
pawn Код:
if(IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys))
To
pawn Код:
if(newkeys == KEY_SECONDARY_ATTACK)



Re: Command not working - DDodo - 21.05.2011

There are other moving objects under
pawn Код:
if(IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys))
so I dont think that's the problem...