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(playerid, newkeys, oldkeys)
{
if(GetPlayerWeapon(playerid) > 1 && 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.