Jump to content

Cum scapi de Flood 99% TESTAT!!!!


KingZone

Recommended Posts

Am vazut multi playeri care se plang de bugul la data acela cu 99/99/99999999, am decis sa fac un tutorial cum sa scapi de ele, nu este cine stie ce, dar mi-am incerca norocul si vreau sa ii scap de noobi ce fac bugul, unor scripteri incepatori, ce nu au experienta ;).

Dam un search folosind dd/mm/yyyy, apoi la else if(RegistrationStep[playerid] == 2) schimbam tot ce este cu strval in strvalEx, ca sa nu va chinuiti cautand, copiati peste cod asta
Code: [select]

else if(RegistrationStep[playerid] == 2)
{
new year, month,day;
getdate(year, month, day);
new DateInfo[3][20];
split(text, DateInfo, '/');
if(year - strvalEx(DateInfo[2]) > 100 || strvalEx(DateInfo[2]) < 1 || strvalEx(DateInfo[2]) >= year)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "What is your Birthdate? (Use dd/mm/yyyy)");
return 0;
}
new check = year - strvalEx(DateInfo[2]);
if(check == year)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "What is your Birthdate? (Use dd/mm/yyyy)");
return 0;
}
if(strvalEx(DateInfo[1]) > month)
{
check -= 1;
}
else if(strvalEx(DateInfo[1]) == month && strvalEx(DateInfo[0]) > day)
{
check -= 1;
}
PlayerInfo[playerid]


= check;
format(string, sizeof(string), "Ok, so you are %d year old.",PlayerInfo[playerid]

);

SendClientMessage(playerid, COLOR_YELLOW2, string);
RegistrationStep[playerid] = 3;
SendClientMessage(playerid, COLOR_LIGHTRED, "What is your Origin? (Type in: SF - te vei spawna in SF, LS - te vei spawna il LS)");
return 0;
}

Apoi la sfarsitul scriptului adaugati

Code: [select]
}
stock strvalEx( const string[] ) // fixing bug with > 50 letters.
{
if( strlen( string ) >= 50 ) return 0; // It will just return 0 if the string is too long
return strval(string);
}

 

  • Upvote 1
Link to comment
Share on other sites

Bai,nu stiu de la cine ai copiat,dar iti sugerez treaba urmatoare:
Daca vrei sa scapi 100% de flood pe sa-mp ti-as sugera sa pui minconnectiontime 1000
 
in server.cfg.

Aceasta treaba verifica si lasa serverul ca un player sa se conecteze 1/s.Voi daca aveti flood puteti pune si un numar cat mai mic,spre exemplu 200 300 500 etc..

  • Upvote 1

 

 

Link to comment
Share on other sites

  • 1 year later...

Bai,nu stiu de la cine ai copiat,dar iti sugerez treaba urmatoare:
Daca vrei sa scapi 100% de flood pe sa-mp ti-as sugera sa pui minconnectiontime 1000
 
in server.cfg.

Aceasta treaba verifica si lasa serverul ca un player sa se conecteze 1/s.Voi daca aveti flood puteti pune si un numar cat mai mic,spre exemplu 200 300 500 etc..

daca pui mai bine minconnectiontime 0 nu ar fii mai bine?

Edited by Geani

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.