i want do the same than Cod-Mod ...
its register the plugin whitout add it in plugins.ini
this will works?
Code:
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
//registrar clases
new Path[256];
get_configsdir(Path, charsmax(Path));
formatex(Path, charsmax(Path),"%s/%s", Path, gFileName);
if(!file_exists(Path))
{
client_print(0, print_chat, "[NeoDeathMatch] El archivo %s no existe", gFileName);
return PLUGIN_HANDLED;
}
new f = fopen(Path, "rt");
new iName[ITEMSLEN+1];
new Item;
while(!feof(f))
{
fgets(f, iName, charsmax(iName));
if(!iName[0] || iName[0] == ';'
|| iName[0] == '/' && iName[1] == '/' ) continue;
copy(gItems[Item], charsmax(gItems), iName);
Item++;
if(Item >= Cid) break;
new plugin_id = find_plugin_byfile(iName) // Tira -1 si no lo encuentra.
new forwards_id, null_id;
if( plugin_id == INVALID_PLUGIN_ID )
{
return log_error(AMX_ERR_NOTFOUND, "Plugin no encontrado")
}
else
{
forwards_id = CreateOneForward(plugin_id, "plugin_init", FP_CELL, FP_STRING)
if( forwards_id < 0 )
{
return log_error(AMX_ERR_NATIVE, "Error Creando Forward")
}
else
{
if( !ExecuteForward(forwards_id, null_id) )
{
return log_error(AMX_ERR_NATIVE, "Error executando Forward")
}
else
{
DestroyForward(forwards_id);
}
}
}
return 1
}
fclose(f);
return 1
}