Cum sa scapam de flood la 99/99/9999999
Pagina 1 din 1
Cum sa scapam de flood la 99/99/9999999
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/*cenzurat*/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 [/color]
else if(RegistrationStep[playerid] == 2)
Apoi la sfarsitul scriptului adaugati
[code]}
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);
Dam un search folosind dd/*cenzurat*/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 [/color]
else if(RegistrationStep[playerid] == 2)
- Cod:
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/*cenzurat*/yyyy)");
return 0;
}
new check = year - strvalEx(DateInfo[2]);
if(check == year)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "What is your Birthdate? (Use dd/*cenzurat*/yyyy)");
return 0;
}
if(strvalEx(DateInfo[1]) > month)
{
check -= 1;
}
else if(strvalEx(DateInfo[1]) == month && strvalEx(DateInfo[0]) > day)
{
check -= 1;
}
PlayerInfo[playerid][pAge] = check;
format(string, sizeof(string), "Ok, so you are %d year old.",PlayerInfo[playerid][pAge]);
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]}
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);
w3b'zZ- Level 20
- Varsta : 28
Pagina 1 din 1
Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum
Mier Noi 28, 2012 9:54 pm Scris de alextegla
» VitalisMetin2 24/24
Sam Noi 05, 2011 9:27 pm Scris de KingSined
» Mafia20000 Web-Browser Game
Dum Oct 30, 2011 9:46 am Scris de arsenium
» DarkAngelmt2
Sam Oct 29, 2011 6:06 pm Scris de Forkey
» Metin2 Mania
Vin Oct 28, 2011 12:06 pm Scris de leoni11
» [Prezentare]SpikeLikeCookie Revine
Mier Oct 26, 2011 5:59 pm Scris de SpiKeLikeCookie
» Login bug Rezolvat definitiv
Mier Oct 26, 2011 3:58 pm Scris de alquaida
» Metin2Ea SERVER 1
Mier Oct 26, 2011 12:42 pm Scris de florin95
» Metin2Arena -PVM
Mier Oct 26, 2011 12:36 pm Scris de florin95