Reset Posted March 21, 2018 Report Share Posted March 21, 2018 (edited) Salut,eu sunt nou pe aceasta comunitate,si unii nu stiu cum sa faca un anti-flood la comanda /report sau alte dialoguri. Deci sa incepem. Mergem la public OnDialogResponse si scriem acest cod if(strfind(inputtext, "%", true) != -1) { SendClientMessage(playerid, COLOR_GENANNOUNCE, "SERVER: Invalid dialog input. You can't use %%."); ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, "Invalid dialog input", "Invalid dialog input", "OK", "Exit"); return 1; } Daca puneti asta nu va mai poate pica nimeni prin comanda /report /changepass sau unele comenzi,care mai au dialoguri. Sper ca v-a placut,astept hate din partea celor care se dau marii. Edited March 21, 2018 by RebornAdv Am gresit ceva. 1 Quote mai tare e bigzone Link to comment Share on other sites More sharing options...
Reset Posted March 21, 2018 Author Report Share Posted March 21, 2018 Unii.. Quote mai tare e bigzone Link to comment Share on other sites More sharing options...
LeonardPWN Posted March 21, 2018 Report Share Posted March 21, 2018 Metode antice 1 Quote Link to comment Share on other sites More sharing options...
Reset Posted March 21, 2018 Author Report Share Posted March 21, 2018 Ce?Nu e bun cumva? Quote mai tare e bigzone Link to comment Share on other sites More sharing options...
Mister Posted March 21, 2018 Report Share Posted March 21, 2018 47 minutes ago, LeonardPWN said: Metode antice Poti da si un exemplu de metoda mai performanta daca tot ii strigi baiatului te rog? Multumesc Quote __ ____ __ / |/ (_)____/ /____ _____ / /|_/ / / ___/ __/ _ \/ ___/ / / / / (__ ) /_/ __/ / /_/ /_/_/____/\__/\___/_/ SERVICII SCRIPTING DE CALITATE Pagina Scripting pawn Link to comment Share on other sites More sharing options...
skillzw0w Posted March 21, 2018 Report Share Posted March 21, 2018 Folositor pentru incepatori Quote Link to comment Share on other sites More sharing options...
Reset Posted March 21, 2018 Author Report Share Posted March 21, 2018 @SkillZ_IT. mersi. Quote mai tare e bigzone Link to comment Share on other sites More sharing options...
Reset Posted March 21, 2018 Author Report Share Posted March 21, 2018 34 minutes ago, SkillZ_IT. said: Folositor pentru incepatori Mersi. <3 Quote mai tare e bigzone Link to comment Share on other sites More sharing options...
Kidro SA-MP Posted March 28, 2018 Report Share Posted March 28, 2018 e ok pentru cei care nu stiu. Quote Link to comment Share on other sites More sharing options...
Goad Posted April 1, 2018 Report Share Posted April 1, 2018 (edited) La 3/21/2018 la 20:55, Mister a spus: Poti da si un exemplu de metoda mai performanta daca tot ii strigi baiatului te rog? Multumesc On : Folositor Off :A tacut din gura pe vecie Edited April 1, 2018 by Goad Quote Link to comment Share on other sites More sharing options...
Flint Posted February 12, 2019 Report Share Posted February 12, 2019 Nu cumva e mai bun asta ? if(strlen(inputtext) >= 1) { if(strfind(inputtext, "%", true) != -1 || strfind(inputtext, "`", true) != -1 || strfind(inputtext, "'", true) != -1) return SCM(playerid, COLOR_LIGHTBLUE, "Caractere invalide!"); } Quote Link to comment Share on other sites More sharing options...
Banditul Posted February 12, 2019 Report Share Posted February 12, 2019 Acum 51 minute, Flint331 a spus: Nu cumva e mai bun asta ? if(strlen(inputtext) >= 1) { if(strfind(inputtext, "%", true) != -1 || strfind(inputtext, "`", true) != -1 || strfind(inputtext, "'", true) != -1) return SCM(playerid, COLOR_LIGHTBLUE, "Caractere invalide!"); } for (new i = 0, l = strlen(inputtext); i < l; i ++) { if (inputtext[i] == '%') { inputtext[i] = '#'; } } Mult mai buna. apropo, daca nu vrei sa priemsti SQL Injection prin folosirea de apostrof etc mai bine protejeaza query cu mysql_escape_string sau %e in mysql_format Quote Link to comment Share on other sites More sharing options...
nobilzeusAdv Posted February 14, 2019 Report Share Posted February 14, 2019 Mai orice gamemode are deja acest lucru. Topic inutil și făcut prost Quote Link to comment Share on other sites More sharing options...
Kiran Posted February 14, 2019 Report Share Posted February 14, 2019 Acum 2 ore, nobilzeusAdv a spus: Mai orice gamemode are deja acest lucru. Topic inutil și făcut prost incepatorii ce vor sa faca un server de la 0 (chiar daca se inspira din alte gm-uri) au nevoie de chestia asta. Quote Ares4 =( Link to comment Share on other sites More sharing options...
nobilzeusAdv Posted February 14, 2019 Report Share Posted February 14, 2019 1 oră în urmă, Kiran a spus: incepatorii ce vor sa faca un server de la 0 (chiar daca se inspira din alte gm-uri) au nevoie de chestia asta. macar daca il facea cum trebuie Quote Link to comment Share on other sites More sharing options...
khain.dev Posted February 15, 2019 Report Share Posted February 15, 2019 Sunt metode mai moderne ca serverul sa pice chiar daca nu folosim % , ceea ce ai aratat e cea mai simpla modalitate 1 Quote Link to comment Share on other sites More sharing options...
K1nG. Posted February 16, 2019 Report Share Posted February 16, 2019 mai bn faci asa new bool:anuntat = false; if(!isnull(inputtext)) { for(new _pos; inputtext[_pos] > 0; _pos++) { if(inputtext[_pos] == '%') { inputtext[_pos] = '#'; if(!anuntat) { SendClientMessage(playerid, -1, "Info: {FFFFFF}Au fost detectate caractere invalide! Acestea au fost automat eliminate!"); anuntat = true; } } } } mult mai ok. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.