Raised This Month: $ Target: $400
 0% 

How to Strip weapon correctly ??


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
assd
Junior Member
Join Date: Jul 2008
Old 01-05-2009 , 07:57   How to Strip weapon correctly ??
Reply With Quote #1

I use strip_weapon function

Code:
public strip_weapon(id, weaponid){
 if ((weaponid < 1) || (weaponid == 2) || (weaponid > 30) || (wepon_mod_initializated == 1)) return 0;
 new wEnt;
 while ((wEnt = engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapons_name[weaponid])) && pev(wEnt,pev_owner) != id ) {}
 if(!wEnt) return 0;

 new c, a
 if (get_user_weapon(id, c, a) == weaponid) ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt)

 if(!ExecuteHamB(Ham_RemovePlayerItem,id,wEnt)) return 0;

 ExecuteHamB(Ham_Item_Kill,wEnt);

 set_pev(id, pev_weapons, pev(id,pev_weapons) & ~(1<<weaponid));
 return 1;
}
This code work normal, but after strip_weapon, the player can't pick up new weapon, untill die. How to correct this problem?
assd is offline
 



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 09:09.


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