|
Prosba o napisanie :)
rafal18 - 09.06.2008 23:29
Prosba o napisanie :)
Witam Bardzo prosił bym o napisanie pluginu który by zawierał 3 pliki tekstowe(tam bym wpisał przekleństwa), i banowało by przekleństwa: w Jednym pliku bany na minute, w drugim na Jeden Dzień, a w Trzecim Perm..
Pozdrawiam
DaddyKuba - 09.06.2008 23:40
Łapaj: Plugin zamienia wybrane słowa na wybrany przez nas tekst. Standardowo jest to taki tekst: [***CENZURA***] Zakaz przeklinania/przezywania [***CENZURA***]
Slowa, które mają byc zamieniane na wybrany przez nas tekst znajdują się w pliku: swearwords. Aby dodac jakies słowo poprostu edutujemy ten plugin i dopisujuemy słowa, które chcemy. Mozna rowniez dodac przez wpisanie komendy w konsoli, która jest podana niżej. Natomiast jesli chcemy dodac lub zmienic tekst na jaki mają byc zamieniane przekleństwa edytujemy plik: replacements. Oczywiscie mozna dodac więcej niż jeden tekst.
Komendy dla admina:
Kod:
amx_addswear < słowo> - Komenda da dodanie wybranego słowa do pliku swearwords.ini (do listy słów, które mają byc cenzurowane)
amx_addreplacement < tekst wyświetlany za cenzurowane słowo > - komenda na dodanie wybranego teksu do pliku replacements.ini
W pliku swearwords.ini znajdują się zarówno słowa angielskie jaki i polskie.
Instrukcja:
* Plik swear_replacement.amxx wrzucamy do cstrike/addons/amxmodx/plugins * Plik replacements.ini wrzucamy do cstrike/addons/amxmodx/configs * Plik swearwords.ini wrzucamy do cstrike/addons/amxmodx/configs * Edytujemy plugins.ini i dopisujemy na końcu: swear_replacement.amxx * Restartujemy serwer.
http://cscenter.pl/attachments/plugi...scenter.pl.rar
rafal18 - 10.06.2008 00:23
Właśnie o to chodzi ze Ja nie chce żeby zamieniało słowa tylko banowało za wybrane słowa i na wybrany czas tak jak napisałem w pierwszym poście...
AAA i jeszcze chcialbym jak by ktos np dostal bana to zeby byl powod: Zostales zbanowany za obrazanie na 1 min,1 dzien lub Pernametnie...
!~* eMo SeBu$ *~! - 10.06.2008 16:16
Cytat:
AAA i jeszcze chcialbym jak by ktos np dostal bana to zeby byl powod: Zostales zbanowany za obrazanie na 1 min,1 dzien lub Pernametnie...
tzn za te bluzgi ?
DaddyKuba - 10.06.2008 21:14
To ja nie wiem o takim czymś. Ale jak masz Amx_MiniBans to wpisujesz powód IP/Nick?ID STEAMA i na jaki czas...
rafal18 - 12.06.2008 00:23
Cytat:
tzn za te bluzgi ?
Tak za te bluzgi :)
Kod:
#include <amxmod>
// max number of words in word list
#define MAX_WORDS 100
// file to read words from
new g_offenceFile[] = "addons/amxmodx/plugins/wordfilter/offence.txt"
new g_swearsFile[] = "addons/amxmodx/plugins/wordfilter/swears.txt"
new g_spamFile[] = "addons/amxmodx/plugins/wordfilter/spam.txt"
new logfilename[256]
new g_offenceNames[MAX_WORDS][32]
new g_offenceNum
new g_swearsNames[MAX_WORDS][32]
new g_swearsNum
new g_spamNames[MAX_WORDS][32]
new g_spamNum
public plugin_init() {
register_plugin("Word Filter","1.0","B@ku")
register_clcmd("say","Punish")
register_clcmd("say_team","spamFilter")
register_clcmd("say_team","Punish")
readoffenceList( g_offenceFile )
readswearsList( g_swearsFile )
readspamList( g_spamFile )
return PLUGIN_CONTINUE
}
readoffenceList(filename[]) {
if(!file_exists(filename) ) {
log_message("Offence Filter: file %s not found", filename)
return
}
new iLen
while( g_offenceNum < MAX_WORDS && read_file(filename, g_offenceNum ,g_offenceNames[g_offenceNum][1],30,iLen) ) {
g_offenceNames[g_offenceNum][0] = iLen
++g_offenceNum
}
}
readswearsList(filename[]) {
if(!file_exists(filename) ) {
log_message("Swear Filter: file %s not found", filename)
return
}
new iLen
while( g_swearsNum < MAX_WORDS && read_file(filename, g_swearsNum ,g_swearsNames[g_swearsNum][1],30,iLen) ) {
g_swearsNames[g_swearsNum][0] = iLen
++g_swearsNum
}
}
readspamList(filename[]) {
if(!file_exists(filename) ){
log_message("Spam Filter: file %s not found", filename)
return
}
new iLen
while( g_spamNum < MAX_WORDS && read_file(filename, g_spamNum ,g_spamNames[g_spamNum][1],30,iLen) ) {
g_spamNames[g_spamNum][0] = iLen
++g_spamNum
}
}
public ban_player_h(param[]) {
new id = param[0]
new name[32]
if (get_user_userid(id) > 0) {
get_user_name(id,name,31)
server_cmd("addip 60 #%d",get_user_userid(id))
client_cmd(id,"echo Zostales zabanowany na 1 godzine za obrazanie graczy !!!")
client_cmd(id,"echo Zostales zabanowany na 1 godzine za obrazanie graczy !!!")
client_cmd(id,"echo Zostales zabanowany na 1 godzine za obrazanie graczy !!!;disconnect")
set_hudmessage(200,0,150, 0.05, 0.3, 2, 0.1, 3.0, 0.02, 0.02, 10)
show_hudmessage(0,"%s zostal zabanowany na 1 godzine za obrazanie graczy",name)
}
return PLUGIN_CONTINUE
}
public ban_player_m(param[]) {
new id = param[0]
new name[32]
if (get_user_userid(id) > 0) {
get_user_name(id,name,31)
client_cmd(id,"echo Zostales zabanowany na 1 minute za przeklinanie !!!")
client_cmd(id,"echo Zostales zabanowany na 1 minute za przeklinanie !!!")
client_cmd(id,"echo Zostales zabanowany na 1 minute za przeklinanie !!!;disconnect")
set_hudmessage(220,80,0, 0.05, 0.3, 2, 0.1, 3.0, 0.02, 0.02, 10)
show_hudmessage(0,"%s zostal zabanowany na 1 minute za przeklinanie",name)
}
return PLUGIN_CONTINUE
}
public Punish(id) {
new szSaid[300]
read_args(szSaid,191)
new bool:found = false
new i = 0
new name[32]
new Data[192]
new Command[32]
new AUTHIP[16]
new AUTHID[39]
new saylog[192]
new logtime[64]
get_user_name(id,name,31)
get_user_ip(id,AUTHIP,16,1)
get_user_authid(id,AUTHID,39)
read_argv(0,Command,32)
read_args(Data,191)
remove_quotes(Data)
new temptext[192]
copy(temptext,191,szSaid)
for (new b=0; b < 20; b++) {
replace(szSaid,191," ","")
replace(szSaid,191,".","")
replace(szSaid,191,",","")
replace(szSaid,191,";","")
replace(szSaid,191,"*","")
replace(szSaid,191,"|","")
replace(szSaid,191,"-","")
replace(szSaid,191,"=","")
replace(szSaid,191,"_","")
replace(szSaid,191,"'","")
replace(szSaid,191,"(","")
replace(szSaid,191,")","")
replace(szSaid,191,"[","")
replace(szSaid,191,"]","")
replace(szSaid,191,"{","")
replace(szSaid,191,"}","")
replace(szSaid,191,"!","i")
replace(szSaid,191,"1","l")
replace(szSaid,191,"3","e")
replace(szSaid,191,"4","a")
replace(szSaid,191,"5","s")
replace(szSaid,191,"6","b")
replace(szSaid,191,"0","o")
replace(szSaid,191,"@","a")
replace(szSaid,191,"q","ku")
replace(szSaid,191,"Q","ku")
replace(szSaid,191,"v","w")
replace(szSaid,191,"V","w")
replace(szSaid,191,"x","ks")
replace(szSaid,191,"X","ks")
replace(szSaid,191,"aa","a")
replace(szSaid,191,"AA","a")
replace(szSaid,191,"bb","b")
replace(szSaid,191,"BB","b")
replace(szSaid,191,"cc","c")
replace(szSaid,191,"CC","c")
replace(szSaid,191,"dd","d")
replace(szSaid,191,"DD","d")
replace(szSaid,191,"ee","e")
replace(szSaid,191,"EE","e")
replace(szSaid,191,"ff","f")
replace(szSaid,191,"FF","f")
replace(szSaid,191,"gg","g")
replace(szSaid,191,"GG","g")
replace(szSaid,191,"hh","h")
replace(szSaid,191,"HH","h")
replace(szSaid,191,"ii","i")
replace(szSaid,191,"II","i")
replace(szSaid,191,"jj","j")
replace(szSaid,191,"JJ","j")
replace(szSaid,191,"kk","k")
replace(szSaid,191,"KK","k")
replace(szSaid,191,"ll","l")
replace(szSaid,191,"LL","l")
replace(szSaid,191,"mm","m")
replace(szSaid,191,"MM","m")
replace(szSaid,191,"nn","n")
replace(szSaid,191,"NN","n")
replace(szSaid,191,"oo","o")
replace(szSaid,191,"OO","o")
replace(szSaid,191,"pp","p")
replace(szSaid,191,"PP","p")
replace(szSaid,191,"qq","q")
replace(szSaid,191,"QQ","q")
replace(szSaid,191,"rr","r")
replace(szSaid,191,"RR","r")
replace(szSaid,191,"ss","s")
replace(szSaid,191,"SS","s")
replace(szSaid,191,"tt","t")
replace(szSaid,191,"TT","t")
replace(szSaid,191,"uu","u")
replace(szSaid,191,"UU","u")
replace(szSaid,191,"vv","v")
replace(szSaid,191,"VV","v")
replace(szSaid,191,"ww","w")
replace(szSaid,191,"WW","w")
replace(szSaid,191,"xx","x")
replace(szSaid,191,"XX","x")
replace(szSaid,191,"yy","y")
replace(szSaid,191,"YY","y")
replace(szSaid,191,"zz","z")
replace(szSaid,191,"ZZ","z")
}
while ( i < g_offenceNum ) {
if (containi(szSaid,g_offenceNames[i][1]) != -1 ){
found = true
break
}
++i
}
if ( found ) {
get_time("%H:%M",logtime,64)
get_time("addons/amxmodx/logs/offence%m%d.log",logfilename,255)
format(saylog, 192, "%s %s %s %s - %s : %s",logtime, AUTHIP, AUTHID, name, Command, Data)
write_file(logfilename, saylog, -1)
new cmd[32]
read_argv(0,cmd,31)
if (get_user_flags(id)&ADMIN_IMMUNITY) {
engclient_cmd(id,cmd,temptext)
return PLUGIN_HANDLED
}
engclient_cmd(id,cmd,temptext)
set_hudmessage(200,0,150, 0.05, 0.3, 2, 0.1, 3.0, 0.02, 0.02, 10)
show_hudmessage(id,"NIE OBRAZAJ GRACZY !!!^nZa kare zostajesz zabanowany na 1 godzine !")
server_cmd("addip 60 #%d",get_user_userid(id))
new param[2]
param[0] = id
set_task(4.0,"ban_player_h",id,param,2)
} else {
i = 0
while ( i < g_swearsNum ) {
if (containi(szSaid,g_swearsNames[i][1]) != -1 ) {
found = true
break
}
++i
}
if ( found ) {
get_time("%H:%M",logtime,64)
get_time("addons/amxmodx/logs/swears%m%d.log",logfilename,255)
format(saylog, 192, "%s %s %s %s - %s : %s",logtime, AUTHIP, AUTHID, name, Command, Data)
write_file(logfilename, saylog, -1)
new cmd[32]
read_argv(0,cmd,31)
if (get_user_flags(id)&ADMIN_IMMUNITY) {
engclient_cmd(id,cmd,temptext)
return PLUGIN_HANDLED
}
engclient_cmd(id,cmd,temptext)
set_hudmessage(220,80,0, 0.05, 0.3, 2, 0.1, 3.0, 0.02, 0.02, 10)
show_hudmessage(id,"NIE PRZEKLINAJ !!!^nZa kare zostajesz zabanowany na 1 minute !")
server_cmd("addip 1 #%d",get_user_userid(id))
new param[2]
param[0] = id
set_task(4.0,"ban_player_m",id,param,2)
}
}
return PLUGIN_CONTINUE
}
public spamFilter(id) {
new szSaid[300]
read_args(szSaid,191)
new bool:found = false
new i = 0
while ( i < g_spamNum ) {
if (containi(szSaid,g_spamNames[i][1]) != -1 ) {
found = true
break
}
++i
}
if ( found )
return PLUGIN_HANDLED
return PLUGIN_CONTINUE
}
Seba znalazlem cos takiego zobacz czy to sie nadaje :)
zanotowane.pldoc.pisz.plpdf.pisz.plqup.pev.pl
|