21.05.2014, 12:15
Код:
case DIALOG_REGISTER: { new pname[24], plIP[15]; GetPlayerName(playerid, pname, 24); GetPlayerIp(playerid, plIP, 15); if(!response) return Kick(playerid); if(strlen(inputtext) < 6) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", "In order to play, you need to register.\nYour password must be at least 6 characters long!", "Register", "Quit"); new query[300]; WP_Hash(PlayerInfo[playerid][Password], 129, inputtext); mysql_format(mysql, query, sizeof(query), "INSERT INTO `Accounts` (`Name`, `Password`, `RegisterDate`, `IP`) VALUES('%s', '%s', NOW(), '%s')", pname, PlayerInfo[playerid][Password], plIP); mysql_tquery(mysql, query, "OnAccountRegister", "i", playerid); Logged[playerid] = 1; }