Code:
#include <amxmodx>
new path[62]
public plugin_init() {
register_plugin("Writefiletry","1.00","NL)Ramon(NL")
set_task(10.0,"deletefile")
}
public deletefile(){
new mapname[32]
get_mapname(mapname,31)
format(path,61,"addons/amxmodx/configs/maps/%s.cfg",mapname)
if (file_exists(path))
{
delete_file(path)
}
set_task(0.5,"setfile")
}
public setfile(){
new x_start[32]
format("x_start",31,"x_start %d",get_cvar_num("x_start"))
write_file(path, x_start,0)
new y_start[32]
format("y_start",31,"y_start %d",get_cvar_num("y_start"))
write_file(path, y_start,1)
new z_start[32]
format("z_start",31,"z_start %d",get_cvar_num("z_start"))
write_file (path, z_start,2)
}
It compiles normal, but when i use it it writes an empty line!
__________________