Raised This Month: $ Target: $400
 0% 

Hook end of reload.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Screeaam..
Senior Member
Join Date: Jun 2010
Location: Poland
Old 10-31-2011 , 16:29   Hook end of reload.
Reply With Quote #1

Hello! I have this code from this topic: http://forums.alliedmods.net/showthread.php?t=123645

And when he is in reload I'm adding to clip 30 ammo, but how to hook when he is end of reloading? Because when I add in this event it doesnt word (It adding and in moment it going to default)
Screeaam.. is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 10-31-2011 , 19:41   Re: Hook end of reload.
Reply With Quote #2

http://forums.alliedmods.net/showthr...ht=hook+reload
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
Screeaam..
Senior Member
Join Date: Jun 2010
Location: Poland
Old 10-31-2011 , 19:50   Re: Hook end of reload.
Reply With Quote #3

I posted the same topic. ;F

There is "When u start reloading" and I want catch when u reload and when ammo id adding to clip.
Screeaam.. is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-31-2011 , 20:29   Re: Hook end of reload.
Reply With Quote #4

Hook CurWeapon for when clip ammo increases on same weapon?
__________________

Last edited by Bugsy; 10-31-2011 at 20:30.
Bugsy is offline
Screeaam..
Senior Member
Join Date: Jun 2010
Location: Poland
Old 11-01-2011 , 12:02   Re: Hook end of reload.
Reply With Quote #5

I made something like this:

Code:
public CurWeapon(id)
{
	new ammo = read_data(3);
	
	if(get_user_weapon(id) == CSW_M4A1)
	{
		if(ammo > old_ammo[id])
		{
			add_ammo[id] = 50/2;
			old_ammo[id] = ammo;
		}
		if(ile_dodac_magazynek[id] > 0)
		{
			new ent = fm_get_user_weapon_entity(id);
			if(ent){
				cs_set_weapon_ammo(ent, ammo+1);
				add_ammo[id]--;
			}
		}
	}
}
Code:
register_event("CurWeapon","CurWeapon","be", "1=1")
But it working only once.

Last edited by Screeaam..; 11-01-2011 at 12:03.
Screeaam.. is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-01-2011 , 23:26   Re: Hook end of reload.
Reply With Quote #6

I don't know if this will solve your problem. If you can't figure it out try to explain better what you're trying to do.
PHP Code:
#include <amxmodx>

enum WeaponInfo
{
    
LastWeapon,
    
LastAmmo
}
new 
g_PData33 ][ WeaponInfo ];

public 
plugin_init() 
{
    
register_event"CurWeapon" "EvCurWeapon" "be" "1=1" );
}

public 
EvCurWeapon(id)
{
    new 
iWeapon read_data);
    new 
iAmmo read_data);
    
    if ( ( 
iWeapon == g_PDataid ][ LastWeapon ] ) && ( iAmmo g_PDataid ][ LastAmmo ] ) )
    {
        
client_printid print_chat "reload complete" );
    }
    
    
g_PDataid ][ LastWeapon ] = iWeapon;
    
g_PDataid ][ LastAmmo ] = iAmmo;

__________________

Last edited by Bugsy; 11-01-2011 at 23:28.
Bugsy is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 12-28-2013 , 03:59   Re: Hook end of reload.
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
I don't know if this will solve your problem. If you can't figure it out try to explain better what you're trying to do.
PHP Code:
#include <amxmodx>
 
enum WeaponInfo
{
    
LastWeapon,
    
LastAmmo
}
new 
g_PData33 ][ WeaponInfo ];
 
public 
plugin_init() 
{
    
register_event"CurWeapon" "EvCurWeapon" "be" "1=1" );
}
 
public 
EvCurWeapon(id)
{
    new 
iWeapon read_data);
    new 
iAmmo read_data);
 
    if ( ( 
iWeapon == g_PDataid ][ LastWeapon ] ) && ( iAmmo g_PDataid ][ LastAmmo ] ) )
    {
        
client_printid print_chat "reload complete" );
    }
 
    
g_PDataid ][ LastWeapon ] = iWeapon;
    
g_PDataid ][ LastAmmo ] = iAmmo;


nice job man...
can you explain the functioning of this code
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
Old 12-28-2013, 04:37
Blizzard_87
This message has been deleted by YamiKaitou. Reason: spam
Old 12-28-2013, 04:41
DavidJr
This message has been deleted by YamiKaitou. Reason: spam
Old 12-28-2013, 04:47
ezio_auditore
This message has been deleted by YamiKaitou. Reason: spam
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 14:28.


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