Raised This Month: $ Target: $400
 0% 

hook reload


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tolpecek
Member
Join Date: Dec 2018
Old 01-05-2019 , 18:56   hook reload
Reply With Quote #1

hello
can somebody show me ho to hook reload event? i need this

Code:
	register_clcmd("+reload","cmdMoveEnt")                                                    
	register_clcmd("-reload","cmdStopEnt")
it moves with blocks on basebuilder.. thanks
tolpecek is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 01-05-2019 , 20:44   Re: hook reload
Reply With Quote #2

Ham_Weapon_Reload
__________________








CrazY. is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-05-2019 , 21:21   Re: hook reload
Reply With Quote #3

Quote:
Originally Posted by CrazY. View Post
Ham_Weapon_Reload
I'm pretty sure that will spam. Look at this thread.
__________________
Bugsy is offline
tolpecek
Member
Join Date: Dec 2018
Old 01-06-2019 , 03:53   Re: hook reload
Reply With Quote #4

Code:
RegisterHam(Ham_Weapon_Reload, "player", "ham_reload",1)
Code:
public ham_reload(id)
{
	if(g_CanBuild)
	{
		cmdMoveEnt(id)
	}
	else 
	{
		cmdStopEnt(id)
	}
}
doesnt work
tolpecek is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-06-2019 , 03:54   Re: hook reload
Reply With Quote #5

You should read all the replies to your posts. I.e. look at what Bugsy said.
__________________
fysiks is offline
tolpecek
Member
Join Date: Dec 2018
Old 01-06-2019 , 05:41   Re: hook reload
Reply With Quote #6

it looks difficult for me
tolpecek is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 01-06-2019 , 06:38   Re: hook reload
Reply With Quote #7

Did you try? If not, you should. If you have problems, try to search or ask here.
__________________








CrazY. is offline
eat1k
Senior Member
Join Date: Apr 2018
Old 01-06-2019 , 07:09   Re: hook reload
Reply With Quote #8

FakeMeta: pev(id, pev_buttons) & IN_RELOAD
I don't think Ham_Weapon_Reload will help you to do what you're trying to do. It's called only when a weapon is reloading so if you will press "R" without reloading a weapon it will not work.
__________________

Last edited by eat1k; 01-06-2019 at 07:10.
eat1k is offline
tolpecek
Member
Join Date: Dec 2018
Old 01-06-2019 , 09:04   Re: hook reload
Reply With Quote #9

Quote:
Originally Posted by eat1k View Post
FakeMeta: pev(id, pev_buttons) & IN_RELOAD
I don't think Ham_Weapon_Reload will help you to do what you're trying to do. It's called only when a weapon is reloading so if you will press "R" without reloading a weapon it will not work.
can u give me an example how to use it?
tolpecek is offline
tolpecek
Member
Join Date: Dec 2018
Old 01-06-2019 , 09:15   Re: hook reload
Reply With Quote #10

Quote:
Originally Posted by eat1k View Post
FakeMeta: pev(id, pev_buttons) & IN_RELOAD
I don't think Ham_Weapon_Reload will help you to do what you're trying to do. It's called only when a weapon is reloading so if you will press "R" without reloading a weapon it will not work.
Code:
register_forward(FM_PlayerPreThink, "fw_Player_PreThink")
Code:
public fw_Player_PreThink(id)
{
	
new buttons = pev(id, pev_button)
if(buttons & IN_RELOAD)
	{
		if(g_CanBuild)
		{
			cmdMoveEnt(id)
		}
		else 
		{
			cmdStopEnt(id)
		}
	}
}
doesnt work

Last edited by tolpecek; 01-06-2019 at 09:15.
tolpecek 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 07:39.


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