if(dialogid == DIALOG_REGISTER){ if(response) { if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_PASSWORD,\"Register\",\"Enter Password !\",\"Register\",\"Exit\"); new EscapePass[60],string[300],playerip[16]; mysql_real_escape_string(inputtext, EscapePass); GetPlayerIp(playerid, playerip, sizeof(playerip)); SendClientMessage(playerid,COLOR_WHITE,\"You are registered user now \"); format(string,sizeof(string),\"INSERT INTO usersdata(`pName`, `pIP`, `pPass`) VALUES(\'%s\', \'%s\', \'%s\')\",GetName(playerid),playerip,EscapePass); mysql_function_query(cHandle, string, false, \"\", \"\"); strmid(Data[playerid][pName], GetName(playerid), 0, strlen(GetName(playerid)), 255); strmid(Data[playerid][pPass], EscapePass, 0, strlen(EscapePass), 255); strmid(Data[playerid][pIP], playerip, 0, strlen(playerip), 255); MySQL_SaveStats(playerid);}else{ SendClientMessage(playerid,COLOR_RED,\"You choosed to quit\"); Kick(playerid);}}
if(dialogid == DIALOG_LOGIN){if(response) { new EscapedPass[60]; mysql_real_escape_string(inputtext, EscapedPass); if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,\"Login\",\"You are registerd user, to login type your password bellow:\",\"Login\",\"Exit\"); if(strcmp(EscapedPass, Data[playerid][pPass])) { WrongPass[playerid] ++; if(WrongPass[playerid] >= TRYS_BEFORE_KICK) { format(xstring,sizeof(xstring),\"You entered wrong password %d times, you are kicked .\",WrongPass); SendClientMessage(playerid, COLOR_RED,xstring); Kick(playerid); } SendClientMessage(playerid,COLOR_RED,\"Wrong password!\"); format(xstring,sizeof(xstring),\"Wrong password: %d/%d\",WrongPass[playerid],TRYS_BEFORE_KICK); ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,\"Login\",xstring,\"Login\",\"Exit\"); } else { SendClientMessage(playerid,COLOR_GREEN,\"[Login] You successfully logged in ! \"); MySQL_LoadStats(playerid); }}else{ SendClientMessage(playerid,COLOR_RED,\"You choosed to quit\"); Kick(playerid);}}