Raised This Month: $ Target: $400
 0% 

Block reload


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 08-12-2013 , 11:27   Block reload
Reply With Quote #1

Im trying to block usp reload and i found this code on the internet


Code:
RegisterHam(Ham_Weapon_Reload, "weapon_usp", "Reload_Post", 1);
Code:
public Reload_Post(weapon_entity) 
{
 new id = pev(weapon_entity, pev_owner);
 
 if (!is_user_connected(id))
  return HAM_IGNORED;
 if( g_iCurrentDay == DAY_LASERDOME )
  return HAM_SUPERCEDE;
 return HAM_IGNORED;
}
But the usp is reloading anyways when i giving it 1 bullet

Here is my give 1 bullet code

Code:
 if( g_iCurrentDay == DAY_LASERDOME )  
 {
  get_user_ammo( iPlayer, CSW_USP, clip, ammo ) 
  if ( ammo <= 0 ) 
  {
   cs_set_weapon_ammo(fm_get_weapon_id(iPlayer, "weapon_usp"), 1);
   new ent = find_ent_by_owner( 0, "weapon_usp", iPlayer )
   cs_set_weapon_silen( ent, 1 )
  }  
 }
Code:
stock fm_get_weapon_id(index, const weapon[])
{
 new ent = -1;
 
 while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", weapon)) != 0)
 {
  if(index == pev(ent, pev_owner))
   return ent;
 }
 return 0;
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 08-12-2013 at 11:28.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 08-12-2013 , 12:54   Re: Block reload
Reply With Quote #2

register it as a pre not post
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
Old 08-12-2013, 15:34
ironskillz1
This message has been deleted by ironskillz1. Reason: stupid post
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 08-13-2013 , 04:03   Re: Block reload
Reply With Quote #4

It blocks reload when someone buys a usp and shoots with it

but if i give it 1 bullet it reloads
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-13-2013 , 07:25   Re: Block reload
Reply With Quote #5

Did you register it as a pre like you were told to?
__________________
Black Rose is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 08-13-2013 , 09:09   Re: Block reload
Reply With Quote #6

Quote:
Originally Posted by Black Rose View Post
Did you register it as a pre like you were told to?
Yes
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
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 15:56.


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