case LoginDialog: { if(!response) Kick(playerid); new hashpass[129], query[100], playername[MAX_PLAYER_NAME], string[80]; GetPlayerName(playerid, playername, sizeof(playername)); GetPlayerIp(playerid, IP[playerid], 16); WP_Hash(hashpass, sizeof(hashpass), inputtext); if (!strcmp(IP[playerid], string, true)) { mysql_format(Database, query, sizeof(query), "SELECT * FROM `accounts` WHERE `Name` = '%e' LIMIT 1", ReturnName(playerid)); mysql_tquery(Database, query, "OnAccountLoad", "i", playerid); } else if(!strcmp(hashpass, PlayerInfo[playerid][Password])) { mysql_format(Database, query, sizeof(query), "SELECT * FROM `accounts` WHERE `Name` = '%e' LIMIT 1", playername); mysql_tquery(Database, query, "OnAccountLoad", "i", playerid); } ShowPlayerDialog(playerid, LoginDialog, DIALOG_STYLE_PASSWORD, "Trucking: {FFFF00}Login", "Welcome Back Trucking Veteran, Please login to continue:", "Login", "Leave"); SendClientMessage(playerid, COLOUR_RED, "Wrong Password"); }
ShowPlayerDialog(playerid, LoginDialog, DIALOG_STYLE_PASSWORD, "Trucking: {FFFF00}Login", "Welcome Back Trucking Veteran, Please login to continue:", "Login", "Leave");
SendClientMessage(playerid, COLOUR_RED, "Wrong Password");
case LoginDialog:
{
if(!response) Kick(playerid);
new hashpass[129], query[100], playername[MAX_PLAYER_NAME], string[80];
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerIp(playerid, IP[playerid], 16);
WP_Hash(hashpass, sizeof(hashpass), inputtext);
if (!strcmp(IP[playerid], string, true))
{
mysql_format(Database, query, sizeof(query), "SELECT * FROM `accounts` WHERE `Name` = '%e' LIMIT 1", ReturnName(playerid));
mysql_tquery(Database, query, "OnAccountLoad", "i", playerid);
return 1;
}
else
if(!strcmp(hashpass, PlayerInfo[playerid][Password]))
{
mysql_format(Database, query, sizeof(query), "SELECT * FROM `accounts` WHERE `Name` = '%e' LIMIT 1", playername);
mysql_tquery(Database, query, "OnAccountLoad", "i", playerid);
return 1;
}
ShowPlayerDialog(playerid, LoginDialog, DIALOG_STYLE_PASSWORD, "Trucking: {FFFF00}Login", "Welcome Back Trucking Veteran, Please login to continue:", "Login", "Leave");
SendClientMessage(playerid, COLOUR_RED, "Wrong Password");
}
Код:
new hashpass[129], query[100], playername[MAX_PLAYER_NAME], string[80]; GetPlayerIp(playerid, IP[playerid], 16); if (!strcmp(IP[playerid], string, true)) |