Raised This Month: $ Target: $400
 0% 

Delete a weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 06-19-2006 , 16:44   Delete a weapon
Reply With Quote #1

How would I delete a weapon while it's in someone's hands or when it's dropped?
wonsae is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-19-2006 , 16:49  
Reply With Quote #2

remove_ent if it's on the ground

Or client_cmd(id,"drop",weapon) then do a set task to remove the gun.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 06-19-2006 , 17:07  
Reply With Quote #3

This seems to give me an error :X
Code:
remove_entity("ts_groundweapon")

Code:
Error: Number of arguments does not match definition on line 160
wonsae is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-19-2006 , 17:19  
Reply With Quote #4

It should give you an argument type mismatch.

First, scan for the weapon using find_ent_by_class, or find_sphere_class. Use the return from that and then do remove_entity(iEnt)
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 06-19-2006 , 17:30  
Reply With Quote #5

Code:
public remove(id){     new ent = find_ent_by_class(id,"ts_groundweapon")     if(ent == 1){         remove_entity(ent)     }     return PLUGIN_HANDLED }

woudl that work?
wonsae is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-19-2006 , 17:35  
Reply With Quote #6

Quote:
Originally Posted by wonsae
Code:
public remove(id){     new ent = find_ent_by_class(id,"ts_groundweapon")     if(ent == 1){         remove_entity(ent)     }     return PLUGIN_HANDLED }

woudl that work?
No.

Code:
public fnRemove(id) {     static iEnt[1]     find_sphere_class(id,"ts_groundweapon",20.0,iEnt,1)     if(iEnt[0])         remove_entity(iEnt[0]) }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 06-19-2006 , 17:40  
Reply With Quote #7

Thanks, but what is a static?
wonsae is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-19-2006 , 17:41  
Reply With Quote #8

Quote:
Originally Posted by wonsae
Thanks, but what is a static?
YOU'LL NEVER KNOW
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 06-19-2006 , 17:51  
Reply With Quote #9

wonsae is offline
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 07:56.


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