Hi
I have a little problem with this code.I tried to reload a file with a command but it is not working(I don't know why).I saw on the another plugin this method and there it's work.
In this file I want to put the names of players (even if i think it does not matter)
I hope you can fix that or tell me where i'm wrong
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <celltrie>
new gfi_WorkFile[ 128 ];
new const gs_VipsFile[ ] = "file.ini";
new Trie:file_reload;
public plugin_init()
{
register_plugin("File Beta","1.0", "Hasky")
register_concmd("amx_reloadfile", "reloadfile")
file_reload = TrieCreate()
}
public plugin_cfg ( )
{
new fi_Dir[ 64 ];
get_configsdir ( fi_Dir, charsmax ( fi_Dir ) );
formatex ( gfi_WorkFile, charsmax ( gfi_WorkFile ), "%s/%s", fi_Dir, gs_VipsFile );
}
public reloadfile(id)
{
TrieClear(file_reload)
new s_Buffer[ 192 ], i_Line, i_Len, name[32];
while ( ( i_Line = read_file ( gfi_WorkFile, i_Line, s_Buffer, charsmax ( s_Buffer ), i_Len ) ) )
{
if ( ! strlen ( s_Buffer ) || s_Buffer[ 0 ] == ';' || ( s_Buffer[ 0 ] == '/' && s_Buffer[ 1 ] == '/' ) )
continue;
parse(s_Buffer, name, charsmax(name))
if(!name[0])
continue
TrieSetCell(file_reload, name, 1);
}
}