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

how to disable automatic reloading in cs guns?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 05-30-2010 , 12:40   how to disable automatic reloading in cs guns?
Reply With Quote #1

how to disable automatic reloading in cs guns?
__________________
Voi is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-30-2010 , 12:44   Re: how to disable automatic reloading in cs guns?
Reply With Quote #2

I can't think of a clean way to do it at the moment, but does anyone know if FM_CmdStart is called on automatic reloading along with manual reloading?
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 05-30-2010 , 12:57   Re: how to disable automatic reloading in cs guns?
Reply With Quote #3

Well i was rather thinking about weapon entity variable than doing it with hooks, blocks etc.

I remember there was an offset telling the weapon is autoreloadable, but im not sure if it can be set by server.
__________________
Voi is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-31-2010 , 16:19   Re: how to disable automatic reloading in cs guns?
Reply With Quote #4

You would need to access memory (with orpheu) and change :

int iFlags( void ) { return ItemInfoArray[ m_iId ].iFlags; }

and set ITEM_FLAG_NOAUTORELOAD flag off

From weapons.cpp :
Code:
			// weapon is useable. Reload if empty and weapon has waited as long as it has to after firing
			if ( m_iClip == 0 && !(iFlags() & ITEM_FLAG_NOAUTORELOAD) && m_flNextPrimaryAttack < ( UseDecrement() ? 0.0 : gpGlobals->time ) )
			{
				Reload();
				return;
			}
Or you may do it filtering Ham_Reload if you use Ham, you could for example check if player reload button is pressed or not, not sure it would work though.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Voi
Veteran Member
Join Date: Sep 2006
Location: Gdansk, Poland
Old 05-31-2010 , 17:43   Re: how to disable automatic reloading in cs guns?
Reply With Quote #5

Setting nextattack would work, but it would be messy. Could you provide the whole concept using orpheu, its black magic for me and theres no way I would alone do it in orpheu :<
__________________
Voi is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 05-31-2010 , 19:09   Re: how to disable automatic reloading in cs guns?
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
Or you may do it filtering Ham_Reload if you use Ham, you could for example check if player reload button is pressed or not, not sure it would work though.
One way is checking at cmdstart for buttons and oldbutton and then set a variable to supercede Ham_Reload or not.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
jim_yang
Veteran Member
Join Date: Aug 2006
Old 05-31-2010 , 22:07   Re: how to disable automatic reloading in cs guns?
Reply With Quote #7

if you use memory hack, just erase the function "Reload(); " in that if statement, that's the simple way.
just write 0x90 (NOP) instead of the original function call instructions
Code:
jmp XXXX or
call XXXX
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-01-2010 , 01:44   Re: how to disable automatic reloading in cs guns?
Reply With Quote #8

Quote:
Originally Posted by joropito View Post
One way is checking at cmdstart for buttons and oldbutton and then set a variable to supercede Ham_Reload or not.
Thing is that no button is involved in automatic reload when weapons are empty.

@Voi
Have no single idea on the memory thing, it's more black for me than for you, i don't use orpheu at all (except 1 or 2 plugins done by other persons for my bhop server).

@jim
He only wants to disable automatic reload, not manual one.


THE JOB IS FOR ARKSHINE (mais d'abord faut qu'il aille débroussailler !!)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 06-01-2010 , 01:55   Re: how to disable automatic reloading in cs guns?
Reply With Quote #9

You are right, what I mean is if your code sample is the auto one, then just disable the reload function call, not the reload function itself, that way is easy than hack other memory part. and I believe auto reload call and manual reload call are not the same one.
cause I'm not on my computer, so I can't confirm that.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 06-01-2010 , 08:27   Re: how to disable automatic reloading in cs guns?
Reply With Quote #10

Quote:
Originally Posted by ConnorMcLeod View Post
Thing is that no button is involved in automatic reload when weapons are empty.
I mean with cmdstart you can know if it's reloading manually or not. (in fact, only manually with cmdstart).
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
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 08:32.


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