Jump to content

[MiniTuT] Cenzúra


Guest Airsoft3r

Recommended Posts

Guest Airsoft3r

... Pridávam sem svoj druhý MiniTuT-ík o cenzúre s vlastnou zložkou pre cenzúrované slová aké chcete...

 

 

===> DEFINE <===

 

#define MAX_SWEARS 100
#define STR 100

 

 

===> NEW <===

 

new Swears[MAX_SWEARS][sTR];
new num_words = 0;

 

 

===> OnFilterScriptInit/OnGameModeInit <===

 

new string[sTR], File:file;
if((file = fopen("cenzura.cfg",io_read))){
while(fread(file,string)){
FixChars(string);
for(new i = 0, j = strlen(string); i < j; i++) if(string[i] == '\n' || string[i] == '\r') string[i] = '\0';
Swears[num_words] = string;
num_words++;}
fclose(file);}

 

 

===> OnPlayerText <===

 

FixChars(text);
for(new s = 0; s < num_words; s++){
new pos;
while((pos = strfind(text,Swears[s],true)) != -1) for(new i = pos, j = pos + strlen(Swears[s]); i < j; i++) text[i] = '*';}

// Tu máte hneď na konci text(i) = '*'; takže to znamienko * sa bude zobrazovať miesto cenzurovaných slov 

 

===> Niekde kde je voľno, ale najlepšie miesto je pod OnPlayerText <===

 


FixChars(string[]) for (new i=0;i

 

 

[color=#FF0000][size=150]//EDIT !! Skoro by som zabudol, že si musíte vytvoriť súbor cenzura.cfg a dať ho do zložky scriptfiles do toho súboru si potom vypíšete slová, ktoré chcete cenzúrovať ![/size][/color]

 

PS:// Je to len MiniTuT, takže nic moc..ale niekto by to chcel na svoj server. ([color=#40BF00]Mám to sám na svojom servery.[/color])

Link to comment
Share on other sites

To SmokeSVK: To ze jsi novacek, neznamena ze tady muzes spamovat prispevkem jako napr jjj

 

Jinak tohle to mam v mode akorad trosku jinak udelany a je fakt, ze si mohl aspon napsat, ze je to zkopceny.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...