Raised This Month: $ Target: $400
 0% 

Strip current wpn


Post New Thread Reply   
 
Thread Tools Display Modes
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
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-19-2009 , 09:11   Re: Strip current wpn
Reply With Quote #2

Try get_user_weapon() + xmod_get_wpnname() + ham_strip_weapon()
Arkshine is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 02-19-2009 , 09:25   Re: Strip current wpn
Reply With Quote #3

no cigar, if i got it right thanks anyway

PHP Code:
new clipammowpn get_user_weapon(idclipammo
  new 
ent_class[32]
  
xmod_get_wpnname wpnent_classsizeof ent_class 1)
 
ham_strip_weapon(ident_class
__________________
Dr.G is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-19-2009 , 09:42   Re: Strip current wpn
Reply With Quote #4

It doesn't work ?
Arkshine is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 02-19-2009 , 09:45   Re: Strip current wpn
Reply With Quote #5

nope
__________________
Dr.G is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-19-2009 , 11:44   Re: Strip current wpn
Reply With Quote #6

Try to print or log the weaponname before you execute ham_strip_weapon and show the result.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 02-19-2009 , 12:16   Re: Strip current wpn
Reply With Quote #7

why the hell didnt i think of that lol
PHP Code:
 
new clipammowpn get_user_weapon(idclipammo
  new 
ent_class[32]
  
xmod_get_wpnname(wpnent_classsizeof ent_class 1
  
client_print(idprint_console,"ent_class is ^"%s^""ent_class)
 
  
ham_strip_weapon(ident_class
Quote:
ent_class is "knife"
so thats why, the ham stock by ava want it to contain weapon_ for it to go on. so i guess ill have to modify that stock
__________________
Dr.G is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 02-19-2009 , 12:22   Re: Strip current wpn
Reply With Quote #8

PHP Code:
new szFormat[99];
format(szFormat98"weapon_%s"ent_class);

ham_strip_weapon(idszFormat); 
try this :]
__________________
xPaw is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 02-19-2009 , 12:39   Re: Strip current wpn
Reply With Quote #9

haha yea xPaw thx... but it doesnt work thats odd, guess that ham stock doesnt like DoD
__________________
Dr.G is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-19-2009 , 12:41   Re: Strip current wpn
Reply With Quote #10

Use get_weaponname and see what the name is.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply


Thread Tools
Display Modes

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