Raised This Month: $ Target: $400
 0% 

Strip current wpn


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Dr.G
Senior Member
Join Date: Nov 2008
Old 02-19-2009 , 09:01   Strip current wpn
Reply With Quote #1

how do i strip the current wpn of a player? Ive tryed this but it didnt do anything:

PHP Code:
new clipammowpn get_user_weapon(idclipammo
  new 
ent_class[32]
  
get_weaponname(wpnent_classsizeof ent_class 1)
 
ham_strip_weapon(ident_class

PHP Code:
// By XxAvalanchexX
stock ham_strip_weapon(id,weapon[])
{
 if(!
equal(weapon,"weapon_",7)) return 0;
 
 new 
wId get_weaponid(weapon);
 if(!
wId) return 0;
 
 new 
wEnt;
 while((
wEnt engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapon)) && pev(wEnt,pev_owner) != id) {}
 if(!
wEnt) return 0;
 
 if(
get_user_weapon(id) == wIdExecuteHamB(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<<wId));
 return 
1;

Its cuz iam makein a throwing knifes mod for DoD, and in DoD there are 3 diffent knifes with 3 diffent classnames...
__________________
Dr.G 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 16:58.


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