21.03.2013, 00:19
(
Последний раз редактировалось Fernado Samuel; 02.06.2013 в 21:37.
)
Removed, thanks for the help!
CMD:register(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "You must enter a password to register on the server!", "Okay", "Cancel");
return 1;
}
dcmd_register(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "You must enter a password to register on the server!", "Okay", "Cancel");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(register, 8, cmdtext);
return 0;
}
CMD:register(playerid, params[])
{
new password[20], query[256], name[MAX_PLAYER_NAME];
if(sscanf(params, "s[20]", password)) return SendClientMessage(playerid, red, "USAGE: /register [password]");
if(strlen(password) <= 4 || strlen(password) > 20) return SendClientMessage(playerid, red, "The password you entered is not strong enough. You must insert a password between 4-20 characters!");
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
mysql_real_escape_string(name, name);
format(query, 256, "SELECT `name_of_player_in_db` FROM `your_table_name` WHERE `name_of_player_in_db` = '%s'", name);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() > 0)
{
SendClientMessage(playerid, red, "Your account is already registered on the server!");
}
else
{
mysql_real_escape_string(password, escpass);
MySQL_Register(playerid, escpass);
}
mysql_free_result();
return 1;
}