Raised This Month: $ Target: $400
 0% 

Block reload


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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