PHP- Kodu:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Reklam Onleyici"
#define VERSION "1.0"
#define AUTHOR "akcaliberkk"
new const file[] = "addons/amxmodx/configs/reklamban.ini";
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
if(!file_exists(file)) {
new f = fopen(file,"wt");
fclose(f);
}
register_clcmd("say","HookSay")
register_clcmd("say_team","HookSay")
}
public HookSay(id) {
new szSaid[248];
read_args(szSaid,247)
remove_quotes(szSaid)
new szWord[64],szReason[64],szFlag[10];
new LineText[148],txtlen;
new maxlines = file_size(file,1);
new name[32];
get_user_name(id,name,31)
for(new line;line<maxlines;line++) {
read_file(file,line,LineText,147,txtlen);
parse(LineText,szWord,63,szReason,63,szFlag,9)
if(containi(szSaid,szWord) != -1) {
if(equali(szFlag,"b")) {
server_cmd("amx_ban #%d 0 ^"%s^"",get_user_userid(id),szReason)
client_print(0,print_chat,"[OTOBAN] %s Adli Oyuncu Reklam Icerikli Mesajdan Dolayi Banlandi.",name)
}
else {
server_cmd("kick #%d ^"%s^"",get_user_userid(id),szReason)
client_print(0,print_chat,"[OTOKICK] %s Adli Oyuncu Reklam Icerikli Mesajdan Dolayi Atildi.",name)
}
break;
}
}
return PLUGIN_HANDLED
}
reklamban.ini:
Kod:
//"yasakli kelime" "atilma sebebi" "atilma metodu"
//Atılma metodları = b: Ban, k: Kick
//Örnek
"www.csplague.com" "Reklamdan dolayi banlandiniz" "b"
"123.123.123.123" "Reklamdan dolayi atildiniz" "k"