16.02.2016, 15:34
Hello ive got code below and im not sure if i can change some things below
Код:
Dialog:Login(playerid, response, listitem, inputtext[]) { if(!response) KickPlayer(playerid, "Failed to login"); //HERE FAILED to login can i change it to desired one? if(response) { new query[300]; if(!strcmp(PasswordHash(inputtext), pInfo[playerid][pPass], false)) { mysql_format(MysqlCon, query, sizeof(query), "SELECT * FROM `users` WHERE `user` = '%e' LIMIT 1", PlayerName(playerid)); mysql_tquery(MysqlCon, query, "OnAccountLoad", "i", playerid); //ALSO HERE OnAccountLoad } else { pInfo[playerid][LoginAttempt]++; if(pInfo[playerid][LoginAttempt] == 1) { ShowDialog(playerid, 0); SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: "WHITE"You have entered an incorrect password. [1/3]"); } else if(pInfo[playerid][LoginAttempt] == 2) { ShowDialog(playerid, 0); SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: "WHITE"You have entered an incorrect password. [2/3]"); } else if(pInfo[playerid][LoginAttempt] == 3) { SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: "WHITE"You have entered an incorrect password. [3/3]"); KickPlayer(playerid, "Max Password Attemps (3/3)"); //ALSO HERE MAX PW ATTEMPTS } } } return 1; }