PHP- Kodu:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
#define ADMIN_FLAG ADMIN_RCON
new const file[] = "addons/amxmodx/configs/DOSYA_ADI.ini"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say","HookSay")
}
public HookSay(id) {
if(!access(id,ADMIN_FLAG)) return PLUGIN_CONTINUE
new szSaid[148];
new cmd[6],text[64];
read_args(szSaid,147)
remove_quotes(szSaid)
parse(szSaid,cmd,5,text,63)
if(equali(cmd,"/ekle")) {
if(!file_exists(file)) {
client_print(id,print_chat,"[ERROR] ^"%s^" Konumunda Dosya Bulunamadi !",file)
return PLUGIN_HANDLED
}
write_file(file,text)
client_print(id,print_chat,"%s Metni Dosyaya Yeni Bir Satir Olarak Eklendi.",text)
return PLUGIN_HANDLED
}
else if(equali(cmd,"/kaldir")) {
if(!file_exists(file)) {
client_print(id,print_chat,"[ERROR] ^"%s^" Konumunda Dosya Bulunamadi !",file)
return PLUGIN_HANDLED
}
new szLine[64],txtlen,maxlines;
maxlines = file_size(file,1);
for(new line;line<maxlines;line++) {
read_file(file,line,szLine,63,txtlen)
if(equali(szLine,text)) {
write_file(file,"",line)
client_print(id,print_chat,"%s Metni Dosyadan Silindi",text)
return PLUGIN_HANDLED
}
}
client_print(id,print_chat,"Dosyada Oyle Bir Metin Bulunamadi.")
}
return PLUGIN_CONTINUE
}