AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help with error: ED_Alloc: no free adicts (https://forums.alliedmods.net/showthread.php?t=89806)

alan_el_more 04-10-2009 20:34

help with error: ED_Alloc: no free adicts
 
I have this code, and my problem is that when opening the server, i see an error: ED_Alloc: no free adicts

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>

#define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))

new kf_enableg_maxplayers

public plugin_init()
{
    
register_plugin("Knife Fight""0.1""alan_el_more")
    
register_clcmd("say /kf""cmdkf")
    
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 (!
cmd_access(idlevelcid2))
    {
        
client_print(idprint_chat"[KF] %L"LANG_PLAYER"CMD_NOT ")
        return 
PLUGIN_HANDLED;
    }
    
    if(
kf_enable)
    {
        
client_print(idprint_chat"[KF] %L"LANG_PLAYER"ALREADY_ENABLE")
        return 
PLUGIN_HANDLED;
    }
    
    static 
name[32]
    
get_user_name(idname31)
    
set_hudmessage(255000.30.010.05.01.01.0, -1)
    
show_hudmessage(0"[KF] %L"LANG_PLAYER"HUD_ENABLE"name)
    
kf_enable true
    
return PLUGIN_CONTINUE
}

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

public 
fw_TouchWeapon(weaponid)
{
    if (!
is_user_connected(id))
        return 
HAM_IGNORED;
    
    if (
kf_enable && !is_user_bot(id))
        return 
HAM_SUPERCEDE;
    
    return 
HAM_IGNORED;
}

stock fm_give_item(id, const item[])
{
    static 
ent
    ent 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocStringitem))
    if (!
pev_valid(ent)) return;
    
    static 
Float:originF[3]
    
pev(idpev_originoriginF)
    
set_pev(entpev_originoriginF)
    
set_pev(entpev_spawnflagspev(entpev_spawnflags) | SF_NORESPAWN)
    
dllfunc(DLLFunc_Spawnent)
    
    static 
save
    save 
pev(entpev_solid)
    
dllfunc(DLLFunc_Touchentid)
    if (
pev(entpev_solid) != save)
        return;
    
    
engfunc(EngFunc_RemoveEntityent)
}

stock fm_strip_user_weapons(index
{
    new 
ent fm_create_entity("player_weaponstrip");
    if (!
pev_valid(ent))
    return 
0;
    
    
dllfunc(DLLFunc_Spawnent);
    
dllfunc(DLLFunc_Useentindex);
    
engfunc(EngFunc_RemoveEntityent);
    
    return 
1;


thanks in advance :D

ot_207 04-10-2009 21:05

Re: help with error: ED_Alloc: no free adicts
 
I don't see any problem here ...
Try adding in the HLDS shortcut this: -num edicts 4096 (like maxplayers).


All times are GMT -4. The time now is 02:28.

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