Thread: Anti W+M1
View Single Post
Merbo
Member
Join Date: Jul 2012
Old 02-28-2013 , 23:37   Re: Anti W+M1
Reply With Quote #5

Quote:
Originally Posted by MasterOfTheXP View Post
PHP Code:
public Action:OnPlayerRunCmd(client, &buttons, &impulseFloat: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.
Merbo is offline