Raised This Month: $ Target: $400
 0% 

[Solved] Random EngFunc_RemoveEntity Crash - NS


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
tekproxy
New Member
Join Date: Dec 2007
Old 12-11-2007 , 00:00   [Solved] Random EngFunc_RemoveEntity Crash - NS
Reply With Quote #1

When a grenade is thrown, I want to remove the grenade entity and replace it with my own. I have everything working almost perfectly except if I include the code to remove the original grenade entity the server crashes.

I've been messing with this for 12 hours, anyone have any ideas (Natural Selection mod, btw):

Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init()
{ 
    register_plugin("Crash Test", "1.0", "frustrated");
    
    register_forward(FM_SetModel, "fw_setmodel");
}

public fw_setmodel(ent, model[])
{
    if ( !pev_valid(ent) ) {
        return FMRES_IGNORED;
    }
    
    static classname[32];
    pev(ent, pev_classname, classname, 31);
    
    if ( equali(classname, "handgrenade") ) {
        // removes entity, then crashes
        engfunc(EngFunc_RemoveEntity, ent);
    }
    
    return FMRES_IGNORED;
}
It takes 1-10 nades being thrown and then crash. Server restarts. There are no amxx plugin error logs created and I'm running in debug mode.

The only debug info the hl server gives me is totally worthless, as can be expected.

Is there a better place to do this other than FM_SetModel? I saw some code do this for CS in set_model but it was for engine, not fakemeta and it worked... HMMMMMMMMm.

Last edited by tekproxy; 12-19-2007 at 18:15.
tekproxy 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 10:59.


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