Detecting holding a weapon and using it at the same time
#3

Quote:
Originally Posted by Whatname
Посмотреть сообщение
PHP код:
#include <a_samp>
#define HOLDING(%0) \
    
((newkeys & (%0)) == (%0))
    
#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
GetPlayerWeapon(playerid) > && GetPlayerWeapon(playerid) < 40)
    {
        if(
PRESSED(KEY_FIRE) || HOLDING(KEY_FIRE))
        {
             
//player using weapon.
        
}
    }
    return 
1;

Well, I'm using OnPlayerGiveDamage public to get the damage value and such so how can I use it with these codes? Using a variable doesn't seem like a good way, it's probably not gonna work so fast if I'd do that.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)