Raised This Month: $51 Target: $400
 12% 

[CSGO]Any way to force +attack?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Brrdy
Senior Member
Join Date: Feb 2015
Old 03-09-2015 , 20:09   [CSGO]Any way to force +attack?
Reply With Quote #1

Well tried a bunch of stuff now coming here ^_^
__________________
Need help with something regarding your plugin? Or want a new plugin made? For free!!?!?!?!??!? Click HERE! I will do nearly any request <3 If I post in scripting and I resolve and don't post how just shoot me a pm linking me the thread and I will update
Brrdy is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 03-09-2015 , 22:16   Re: [CSGO]Any way to force +attack?
Reply With Quote #2

afaik in OnPlayerRunCmd you can force &buttons to have the bitflag IN_ATTACK and return Plugin_Changed;
__________________
retired

Last edited by shavit; 03-09-2015 at 22:17.
shavit is offline
Brrdy
Senior Member
Join Date: Feb 2015
Old 03-10-2015 , 10:12   Re: [CSGO]Any way to force +attack?
Reply With Quote #3

Quote:
Originally Posted by shavit View Post
afaik in OnPlayerRunCmd you can force &buttons to have the bitflag IN_ATTACK and return Plugin_Changed;
Mind setting it up a little different I tried doing it with just buttons &= IN_ATTACK;
__________________
Need help with something regarding your plugin? Or want a new plugin made? For free!!?!?!?!??!? Click HERE! I will do nearly any request <3 If I post in scripting and I resolve and don't post how just shoot me a pm linking me the thread and I will update
Brrdy is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-10-2015 , 10:16   Re: [CSGO]Any way to force +attack?
Reply With Quote #4

Quote:
Originally Posted by Brrdy View Post
Mind setting it up a little different I tried doing it with just buttons &= IN_ATTACK;
&= won't add the bit. You need to use |= instead.

& - Matches 2 bitsums for like bits
| - Combines 2 bitsums to keep positive bits
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Brrdy
Senior Member
Join Date: Feb 2015
Old 03-10-2015 , 10:18   Re: [CSGO]Any way to force +attack?
Reply With Quote #5

Quote:
Originally Posted by Exolent[jNr] View Post
&= won't add the bit. You need to use |= instead.

& - Matches 2 bitsums for like bits
| - Combines 2 bitsums to keep positive bits
Aww okay so just have it do onplayeruncmd() then have it do the same thing but with a |???
__________________
Need help with something regarding your plugin? Or want a new plugin made? For free!!?!?!?!??!? Click HERE! I will do nearly any request <3 If I post in scripting and I resolve and don't post how just shoot me a pm linking me the thread and I will update
Brrdy is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 03-12-2015 , 01:33   Re: [CSGO]Any way to force +attack?
Reply With Quote #6

Quote:
Originally Posted by Brrdy View Post
Aww okay so just have it do onplayeruncmd() then have it do the same thing but with a |???
pseudo code of the old syntax (I have no idea if they added object-orienated programming yet):
Code:
public Action:OnPlayerRunCmd(client, &buttons)
{
          if(!(buttons & IN_ATTACK))
          {
                    buttons |= IN_ATTACK;
                    return Plugin_Changed;
          }
          
          return Plugin_Continue;
}
Sorry if it doesn't work, I didn't use SourceMod in about a year
__________________
retired
shavit is offline
D.Moder
I uploaded 2 great gameplay plugins here
Join Date: Sep 2009
Location: Sin city
Old 03-12-2015 , 08:26   Re: [CSGO]Any way to force +attack?
Reply With Quote #7

Quote:
Originally Posted by shavit View Post
pseudo code of the old syntax (I have no idea if they added object-orienated programming yet):
Code:
public Action:OnPlayerRunCmd(client, &buttons)
{
          if(!(buttons & IN_ATTACK))
          {
                    buttons |= IN_ATTACK;
                    return Plugin_Changed;
          }
          
          return Plugin_Continue;
}
Sorry if it doesn't work, I didn't use SourceMod in about a year
Oh it will. But I hope this guy knows that he needs to add the condition of when to force attack and when to release
buttons &= ~IN_ATTACK will remove the bit.
__________________
Creator of COD-Life (Half COD, Half Life)
https://forums.alliedmods.net/showthread.php?t=261162
twitter: @D_Moder_61216
D.Moder is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 03-12-2015 , 10:15   Re: [CSGO]Any way to force +attack?
Reply With Quote #8

Quote:
Originally Posted by D.Moder View Post
Oh it will. But I hope this guy knows that he needs to add the condition of when to force attack and when to release
buttons &= ~IN_ATTACK will remove the bit.
In all honesty, one shouldn't need to worry about removing a bitstring as the client itself handles re-updating the server's OnPlayerRunCommand button param everytime the method is called. Most of time removing a key press would be if you want something to happen for 1 frame quickly.
__________________

Last edited by WildCard65; 03-12-2015 at 10:16.
WildCard65 is offline
Brrdy
Senior Member
Join Date: Feb 2015
Old 03-12-2015 , 10:19   Re: [CSGO]Any way to force +attack?
Reply With Quote #9

Oh yeah by the way I set it up to attach to +zoom so when I use an awp it runs the stock I have setup Thanks for help/suggestions
__________________
Need help with something regarding your plugin? Or want a new plugin made? For free!!?!?!?!??!? Click HERE! I will do nearly any request <3 If I post in scripting and I resolve and don't post how just shoot me a pm linking me the thread and I will update
Brrdy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode