Raised This Month: $ Target: $400
 0% 

Make rifles shoot like pistols


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
E1_531G
Senior Member
Join Date: Dec 2017
Old 12-06-2017 , 15:33   Make rifles shoot like pistols
Reply With Quote #1

Hello.
How to make rifles (ak47, m4a1, ...) shoot like pistols?
One mouse1 click => 1 bullet fired.
Hold mouse1 => Only 1 bullet fired, when nothing.
Thanks.
E1_531G is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-06-2017 , 17:31   Re: Make rifles shoot like pistols
Reply With Quote #2

Hook primary attack and force the user to release the fire button after he shot once.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
E1_531G
Senior Member
Join Date: Dec 2017
Old 12-07-2017 , 15:16   Re: Make rifles shoot like pistols
Reply With Quote #3

Quote:
Hook primary attack
Pre or Post?
Quote:
force the user to release the fire button
How?
With pev() and set_pev()?
Using pev_oldbuttons or pev_button? Or other?
E1_531G is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-07-2017 , 15:22   Re: Make rifles shoot like pistols
Reply With Quote #4

Post probably. pev() is for getting a value, set_pev() is for setting it, so set_pev() along with pev_button, and remove the IN_ATTACK button.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
E1_531G
Senior Member
Join Date: Dec 2017
Old 12-07-2017 , 18:10   Re: Make rifles shoot like pistols
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
Post probably. pev() is for getting a value, set_pev() is for setting it, so set_pev() along with pev_button, and remove the IN_ATTACK button.
I'm trying:
Code:
public PrimaryAttack_Post(ent)
{
	new id = get_pdata_cbase( ent, 41, 4 )

	if( 0 < id <= MaxPlayers )
	{
		static button; button = pev( id, pev_button )
		if( button & IN_ATTACK )
		{
			button &= ~IN_ATTACK
			set_pev( id, pev_button, button )

			console_print( id, "Button modified: eliminated IN_ATTACK from user buttons." )
		}
	}
}
Don't work...
The message is printed in console, but behavior of the weapon (ak47) is NOT changed.
E1_531G 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 00:14.


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