Raised This Month: $ Target: $400
 0% 

Removing Weapons by Entity


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 02-11-2005 , 21:07   Removing Weapons by Entity
Reply With Quote #1

Im trying to remove specific weapons that are dropped by players, but im having a hard time getting this to work. I get an error: "unknown entity 97", and I have no Idea whats wrong.... heres the code:

Code:
public handle_drop(id) {     if(!get_cvar_num(MOD))         return PLUGIN_HANDLED     new clip, ammo     new arsenal = get_user_weapon(id, clip, ammo)     if(arsenal == CSW_DEAGLE) {         new model[32]         new tEnt, oId, wEnt         tEnt = find_ent_by_class(-1, "weaponbox")         while(tEnt > 0) {             entity_get_string(tEnt, EV_SZ_model, model, 31)             if(equali(model, "models/w_deagle.mdl")) {                 oId = entity_get_edict(tEnt, EV_ENT_owner)                 if(oId > 0 && oId < 33) {                     remove_entity(tEnt)                     wEnt = find_ent_by_class(-1, "weapon_deagle")                     while(wEnt > -1) {                         oId = entity_get_edict(wEnt, EV_ENT_owner)                         if(oId == tEnt)                             remove_entity(wEnt)                     }                 }             }         }  return PLUGIN_CONTINUE }

I used register_clcmd("drop","handle_drop") to catch a players drop. I don't know why this won't work. The server just crashes when I execute my plugin.... Thanks for the help.

-Knekter
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
 



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 19:20.


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