12.08.2017, 18:35
Hello
I am working to make a /changepassword command in game
so this is the format /changepassword (new password)
So i am having doubt to hash password
Here is the code while registering and how can i make that command
I am working to make a /changepassword command in game
so this is the format /changepassword (new password)
So i am having doubt to hash password
Here is the code while registering and how can i make that command
PHP код:
case DIALOG_REGISTER:
{
if(!response)
return KickDelay(playerid);
if(strlen(inputtext) <= 5)
{
new pesan[300];
//ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registration", "Your password must be longer than 5 characters!\nPlease enter your password in the field below.", "Register", "Leave");
format(pesan, sizeof(pesan), "{ffffff}Welcome to Los Santos {0066ff}Cops {ffffff}and {ff0000}Robbers.\n\n{ffffff}User Name: {ff7a00}%s.\n{ffffff}Ip Address: {ff7a00}%s\n\n{ff0000}Your password must be longer than 5 characters.\n{ffffff}Enter your password..", GetName(playerid),getIP(playerid));
return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "LSCNR - REGISTER", pesan, "Register", "Quit");
}
format(message, 256, "{0066ff}* %s(%d) has connected to the server.", GetName(playerid),playerid);
SendClientMessageToAll(COLOR_WHITE,message);
new query[512];
initTextdraw(playerid);
Player[playerid][sqlCheck]++;
WP_Hash(Player[playerid][playerPassword], 129, inputtext);
mysql_format(koneksi, query, sizeof(query), "INSERT INTO `player` (`name`, `password`, `ip`, `registered`, `lastlogged`) VALUES ('%s', '%s', '%s', now(), now())", safeString(GetName(playerid)), Player[playerid][playerPassword], getIP(playerid));
registerSMF(GetName(playerid), inputtext);
mysql_tquery(koneksi, query, "OnPlayerRegister", "dd", playerid, Player[playerid][sqlCheck]);
}