How can I precache configs to let players download it? With precache generic it says "Invalid file type...skipping download of file.cfg"...
Or other way to do this? (except client_cmd, it give 'server trying to send invalid command')
PHP Code:
#include <amxmodx>
#include <colorchat>
#define PLUGIN "Settings"
#define AUTHOR "Blue Snake."
#define VERSION "1.0"
new bool:set[33]
new const file[16] = "file.cfg"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /execcfg","cmdset")
}
public plugin_precache()
{
if(!file_exists(file))
{
/* Commands like:
write_file(file, "bind f ...")
write_file(file, "alias ... ...")
*/
}
precache_generic(file)
}
public cmdset(id)
{
if(set[id])
{
ColorChat(id, BLUE,"^x04[AMXX]^x01 You've already setted your commands.")
return PLUGIN_HANDLED
}
ColorChat(id, BLUE,"^x04[AMXX]^x01 Done.")
set[id]=true
client_cmd(id,"exec %s",file)
return PLUGIN_HANDLED
}
public client_connect(id)
set[id]=false
public client_disconnect(id)
set[id]=false