17.07.2010, 07:20
How can i make this where if the password is wrong it won't logg you in.
Basically what i'm trying to say is how can i make it detect if the password is right when you enter it in to the dialog and it sends you to this function. Cause as of now when i enter any password it logs me in
pawn Код:
public OnPlayerLogin(playerid,password[])
{
if(IsPlayerConnected(playerid)) {
new DataString[128], Query[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format( Query, sizeof( Query ), "SELECT * FROM `players` WHERE `Username` = '%s'",pname);
mysql_query(Query);
mysql_store_result();
mysql_fetch_field("id", DataString);
PlayerInfo[playerid][pID] = strval(DataString);
PlayerInfo[playerid][pID] = PlayerInfo[playerid][pID];
mysql_fetch_field("Password", DataString);
PlayerInfo[playerid][pKey] = strval(DataString);