In your plugin you have to use :
To register a command like amx_filewrite <text>
retrieve arg with
in the function executed by
and you finish with
Code:
write_file("dir/file.txt",string,-1);
Where :
dir = file directory
file.txt = filename
string = variable where is set the retrieved argument
and -1 if you want to add the line to the end.
I've just given you syntax command but not how to do it, if you need some help I will be glad to help you (not to make the code)
You can check how those functions work by reading .inc files or reading other plugins or checking the doc on this website.
For example - From amxmodx.inc :
Code:
/* Registers function which will be called from client console. */
native register_clcmd(const client_cmd[],const function[],flags=-1, info[]="");