Michal Kuřátko (_Michael_) 49 Odesláno: 2. Únor, 2013 Share Odesláno: 2. Únor, 2013 Čaute, používám jednoduchý systém antireklam a rád bych vám ho zveřejnil 1. Nadefinujeme si webovou adresu našeho serveru #define WEBPAGE "www.pawno.cz" //Změňte si na váš web 2. Vytvoříme si stock, ve kterém zapíšeme domény stock AntiReklama(message[]) { if(strfind(message,"www.",false) != -1 || strfind(message,"http://",false) != -1 //Nadefinujeme zakázané domény... || strfind(message,".sk",false) != -1 || strfind(message,".cz",false) != -1 || strfind(message,".eu",false) != -1 || strfind(message,".net",false) != -1 || strfind(message,".com",false) != -1 || strfind(message,".tk",false) != -1 || strfind(message,".tk",false) != -1 || strfind(message,".ru",false) != -1) { if(strfind(message,WEBPAGE,false) == -1) //Pokud zadá náš web return 1; } new len=strlen(message),numbers; for(new i;i<len;i++) { if(IsCharNumeric(message[i])) numbers++; } return 0; } 3. Vložíme podmínku do OnPlayerText if(AntiReklama(text)) //Pokud zadá zakázaný text { SCM(playerid,RED,"[ Server ]{FFFFFF} Je zakázané dělat reklamu!"); //Odešle hráči varovnou zprávu //BanEx(playerid, Server - Reklama"); //Zabanuje hráče return 0; //Zpráva se neodešle } Link to comment Share on other sites More sharing options...
Administrátor Ewwe 434 Odesláno: 2. Únor, 2013 Administrátor Share Odesláno: 2. Únor, 2013 jednoduše obejitelné Link to comment Share on other sites More sharing options...
Michal Kuřátko (_Michael_) 49 Odesláno: 2. Únor, 2013 Author Share Odesláno: 2. Únor, 2013 Poděl se Link to comment Share on other sites More sharing options...
Administrátor Ewwe 434 Odesláno: 2. Únor, 2013 Administrátor Share Odesláno: 2. Únor, 2013 stačí třeba napsat wWw. nebo WWW. začal bych tím že bych si string převedl na stejné znaky například mojí funkcí stock ToLower(text[]) { for(new i ; i { if(text[i] > 64 && text[i] { text[i] += 32; } } } pak bych z textu odstranil mezery. A pak bych teprve konrolovat jestli v stringu není náznak webu Link to comment Share on other sites More sharing options...
Michal Kuřátko (_Michael_) 49 Odesláno: 2. Únor, 2013 Author Share Odesláno: 2. Únor, 2013 stock AntiReklama(message[]) { if(strfind(message,"www.",false) != -1 || strfind(message,"http://",false) != -1 || strfind(message,".sk",false) != -1 || strfind(message,".cz",false) != -1 || strfind(message,".eu",false) != -1 || strfind(message,".net",false) != -1 || strfind(message,".com",false) != -1 || strfind(message,".tk",false) != -1 || strfind(message,".tk",false) != -1 || strfind(message,".ru",false) != -1) { if(strfind(message,WEBPAGE,false) == -1) return 1; } new len=strlen(message),numbers; for(new i;i<len;i++) { if(IsCharNumeric(message[i])) numbers++; } if(numbers > 7 && numbers < 17) return 1; return 0; } Takhle by to nešlo? Spatlal jsem to narychlo Link to comment Share on other sites More sharing options...
Administrátor Ewwe 434 Odesláno: 2. Únor, 2013 Administrátor Share Odesláno: 2. Únor, 2013 Nějak nechápu o co ti jde. Ale budiž... Link to comment Share on other sites More sharing options...
Michal Kuřátko (_Michael_) 49 Odesláno: 2. Únor, 2013 Author Share Odesláno: 2. Únor, 2013 Půjde to nebo ne? Link to comment Share on other sites More sharing options...
Mivčo 90 Odesláno: 2. Únor, 2013 Share Odesláno: 2. Únor, 2013 nepojde Link to comment Share on other sites More sharing options...
Michal Kuřátko (_Michael_) 49 Odesláno: 2. Únor, 2013 Author Share Odesláno: 2. Únor, 2013 nepojde Důvod? Link to comment Share on other sites More sharing options...
Administrátor Ewwe 434 Odesláno: 2. Únor, 2013 Administrátor Share Odesláno: 2. Únor, 2013 No mimo to že jsem nepobral proč tam cosi děláš s 7 a 17 a td Link to comment Share on other sites More sharing options...
Michal Kuřátko (_Michael_) 49 Odesláno: 2. Únor, 2013 Author Share Odesláno: 2. Únor, 2013 Kontroluje počet zadaných znaků Link to comment Share on other sites More sharing options...
Administrátor Ewwe 434 Odesláno: 2. Únor, 2013 Administrátor Share Odesláno: 2. Únor, 2013 a na co ? Link to comment Share on other sites More sharing options...
Michal Kuřátko (_Michael_) 49 Odesláno: 2. Únor, 2013 Author Share Odesláno: 2. Únor, 2013 Pokud obsahuje méně nebo více znaků, zpráva se odfiltruje Link to comment Share on other sites More sharing options...
FiZZy 12 Odesláno: 2. Únor, 2013 Share Odesláno: 2. Únor, 2013 Dá ti tam mezeru místo teček a jsi nahraný kamaráde Link to comment Share on other sites More sharing options...
Michal Kuřátko (_Michael_) 49 Odesláno: 2. Únor, 2013 Author Share Odesláno: 2. Únor, 2013 Teď si mně dostal Link to comment Share on other sites More sharing options...
Administrátor Ewwe 434 Odesláno: 2. Únor, 2013 Administrátor Share Odesláno: 2. Únor, 2013 Ewwe blbosť... http://wiki.sa-mp.com/wiki/Strfind ignorecase (optional) When set to true, the case doesn't matter - HeLLo is the same as Hello. When false, they're not the same. Takže stačí tam dať true miesto false... jo na to sem zapolměl.... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now