| 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_enable, g_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(id, level, cid) { if (!cmd_access(id, level, cid, 2)) { client_print(id, print_chat, "[KF] %L", LANG_PLAYER, "CMD_NOT ") return PLUGIN_HANDLED; } if(kf_enable) { client_print(id, print_chat, "[KF] %L", LANG_PLAYER, "ALREADY_ENABLE") return PLUGIN_HANDLED; } static name[32] get_user_name(id, name, 31) set_hudmessage(255, 0, 0, 0.3, 0.0, 1, 0.0, 5.0, 1.0, 1.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(255, 0, 0, 0.3, 0.0, 1, 0.0, 5.0, 1.0, 1.0, -1) show_hudmessage(0, "[KF] %L", LANG_PLAYER, "HUD_KF") for(new id = 1; id <= g_maxplayers; id++) { 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(weapon, id) { 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_CreateNamedEntity, engfunc(EngFunc_AllocString, item)) if (!pev_valid(ent)) return; static Float:originF[3] pev(id, pev_origin, originF) set_pev(ent, pev_origin, originF) set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN) dllfunc(DLLFunc_Spawn, ent) static save save = pev(ent, pev_solid) dllfunc(DLLFunc_Touch, ent, id) if (pev(ent, pev_solid) != save) return; engfunc(EngFunc_RemoveEntity, ent) }
stock fm_strip_user_weapons(index) { new ent = fm_create_entity("player_weaponstrip"); if (!pev_valid(ent)) return 0; dllfunc(DLLFunc_Spawn, ent); dllfunc(DLLFunc_Use, ent, index); engfunc(EngFunc_RemoveEntity, ent); return 1; }
thanks in advance :D
|