Raised This Month: $ Target: $400
 0% 

ED_Alloc: no free edicts


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 06-01-2009 , 07:52   ED_Alloc: no free edicts
Reply With Quote #1

hi,
i have this:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>

#define VERSION "1.2"

new g_enableg_hudkf_enableknife_fightg_maxplayers
new g_IsBot[33], g_IsConnected[33]

public 
plugin_init()
{
    
register_plugin("Knife Fight""VERSION""alan_el_more")
    
register_cvar("kf_version"VERSIONFCVAR_SERVER)
    
register_dictionary("Knife_Fight.txt")
    
g_enable register_cvar("kf_enable""1")
    
g_hud register_cvar("kf_hud""1")
    
register_clcmd("say /kf""cmdkf"ADMIN_KICK)
    
register_clcmd("buy""cmdbuy")
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
RegisterHam(Ham_Touch"weaponbox""fw_TouchWeapon")
    
RegisterHam(Ham_Touch"armoury_entity""fw_TouchWeapon")
    
RegisterHam(Ham_Touch"weapon_shield""fw_TouchWeapon")
    
g_maxplayers get_maxplayers()
}

public 
cmdkf(idlevelcid)
{
    if(
get_pcvar_num(g_enable))
    {
        if (!
cmd_access(idlevelcid1))
            return 
PLUGIN_HANDLED;
        
        if(
kf_enable)
        {
            
client_print(idprint_chat"[KF] %L"id"ALREADY_ENABLE")
            return 
PLUGIN_HANDLED;
        }
        
        if(
get_pcvar_num(g_hud))
        {
            new 
name[33]
            
get_user_name(idname32)
            
set_hudmessage(255000.30.010.05.01.01.0, -1)
            
show_hudmessage(0"[KF] %L"LANG_PLAYER"HUD_ENABLE"name)
        }
        
        
kf_enable true
    
}
    else
        
client_print(idprint_chat"[KF] %L"id"KF_DISABLE")
    
    return 
PLUGIN_CONTINUE
}

public 
event_round_start()
{
    if(!
kf_enable)
        return 
PLUGIN_HANDLED
    
    
if(!knife_fight)
        
knife_fight true
    
else
        
knife_fight false
    
    set_hudmessage
(255000.30.010.05.01.01.0, -1)
    
show_hudmessage(0"[KF] %L"LANG_PLAYER"HUD_FK")
    
    for(new 
id 1id <= g_maxplayersid++)
    {
        if(
is_user_alive(id))
        {
            
strip_user_weapons(id)
            
give_item(id"weapon_knife")
        }
    }
    
    
kf_enable false
    
    
return PLUGIN_CONTINUE
}

public 
fw_TouchWeapon(weaponid)
{
    if (
knife_fight && (<= id <= g_maxplayers) && !g_IsBot[id])
        return 
HAM_SUPERCEDE;
    
    return 
HAM_IGNORED;
}

public 
cmdbuy(id)
{
    if(
knife_fight)
        return 
PLUGIN_CONTINUE
        
    
return PLUGIN_HANDLED
}

public 
client_putinserverid )
{
    
g_IsConnected[id] = true;
    
    
g_IsBot[id] = is_user_bot(id)

The problem is that when start a round with the knife fight on, the error (ED_Alloc: no free edicts) appears :S
__________________
alan_el_more is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-01-2009 , 10:33   Re: ED_Alloc: no free edicts
Reply With Quote #2

It's probably because of another plugin. This error happens when there are too many entities spawn in the map. I guess when you strip all the weapons, the free entities are used by another plugin and when you when to readd the knife there are already no more available entities, I think.

It happens whatever the maps ? Did you try to use onyl this plugin ?
__________________
Arkshine is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 06-02-2009 , 10:09   Re: ED_Alloc: no free edicts
Reply With Quote #3

I tried it only with zombie plague deactivated and only in cs_assault
__________________
alan_el_more is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 06-02-2009 , 17:17   Re: ED_Alloc: no free edicts
Reply With Quote #4

You Can Use Ham_Spawn Post, And Check This

PHP Code:
    if(!knife_fight)
        
knife_fight true
    
else
        
knife_fight false 
</SPAN>

And This:
PHP Code:
register_plugin("Knife Fight""VERSION""alan_el_more"
</SPAN>
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 06-03-2009 , 06:56   Re: ED_Alloc: no free edicts
Reply With Quote #5

I think it works wrong because you are trying to give/strip player weapons in new round. Try to do it in player spawn and add some delays.

PHP Code:
register_event("HLTV""event_round_start""a""1=0""2=0"
this is new round (players are not spawned yet), not round start
__________________
Impossible is Nothing

Last edited by Sylwester; 06-03-2009 at 07:08.
Sylwester 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 13:55.


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