Raised This Month: $ Target: $400
 0% 

How to Block 100% weapon reload


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 12-21-2011 , 07:11   How to Block 100% weapon reload
Reply With Quote #1

I have this code:
PHP Code:
#include <hamsandwich>
#include <fakemeta>

new bool:block_reload[33]

public 
plugin_init()
{
     
RegisterHam(Ham_Weapon_Reload"weapon_m249""fw_weapon_reload")
}

public 
fw_weapon_reload(ent)
{
     static 
id
     id 
pev(entpev_owner)

     if(
block_reload[id])
           return 
HAM_SUPERCEDE

     
return HAM_HANDLED

This code only block manual reload by press (R) button. It didn't block auto reload... When the ammo turn to 0, the weapon auto reload. How to block it
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 12-21-2011 , 07:37   Re: How to Block 100% weapon reload
Reply With Quote #2

Code:
cs_set_user_bpammo( id , CSW_M249 , 0 )
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Old 12-21-2011, 18:42
Bos93
This message has been deleted by Bos93.
Bos93
Veteran Member
Join Date: Jul 2010
Old 12-21-2011 , 18:49   Re: How to Block 100% weapon reload
Reply With Quote #4

Code:
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >

new block[33];

public plugin_init() RegisterHam(Ham_Weapon_Reload, "weapon_m249", "Reload_Post", 1);
	
public Reload_Post(weapon_entity) 
{
	new id = pev(weapon_entity, pev_owner);
	
	if (!is_user_connected(id))
		return HAM_IGNORED;

	if (block[id])
		return HAM_SUPERCEDE;

	return HAM_IGNORED;
}
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
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 11:51.


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