|
Member
|
02-28-2013
, 23:37
Re: Anti W+M1
|
#5
|
Quote:
Originally Posted by MasterOfTheXP
PHP Code:
public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
{
if (IsPlayerAlive(client))
{
if (buttons & IN_ATTACK == IN_ATTACK)
{
Er...what?
Though granted, that would work, considering that checks if buttons & IN_ATTACK is equal to 1 (true), and IN_ATTACK is, coincidentally, 1 (1 << 0). But it can just be shortened to if (buttons & IN_ATTACK).
|
I'd asked asherkin the other day about such bitmasks and was told to do it that way.
Alright.
|
|
|
|