Problem with multiple key holds
#3

All your original code does is consider a single key at any time. Checking if they are pressing that key is correct, but you need to check that the released key is also the fire key. Otherwise, if a player is holding the fire key but then presses forwards too, it is not the fire key so it disables the function. Under OnPlayerKeyStateChange, do:

pawn Код:
if ( ( oldkeys - newkeys ) == KEY_FIRE )
{
    // stopped firing
}
else
if ( ( newkeys - oldkeys ) == KEY_FIRE )
{
    // firing
}
This checks that the key released is the fire key
Reply


Messages In This Thread
Problem with multiple key holds - by CaveDweller - 30.07.2013, 11:43
Re: Problem with multiple key holds - by JimmyCh - 30.07.2013, 11:47
Re: Problem with multiple key holds - by FUDDS - 30.07.2013, 11:55
Re: Problem with multiple key holds - by Konstantinos - 30.07.2013, 11:59
Re: Problem with multiple key holds - by FUDDS - 30.07.2013, 12:01
Re: Problem with multiple key holds - by CaveDweller - 30.07.2013, 22:20

Forum Jump:


Users browsing this thread: 1 Guest(s)