22.07.2014, 21:00
Note: I'm really new with MYSQL so please give full explanations.
So i've been trying to get my script to understand that the field "NAME" with the username %s, GetName(playerid) will allow them to login, but it keeps sending them to register dialog.
Account Checking
So i've been trying to get my script to understand that the field "NAME" with the username %s, GetName(playerid) will allow them to login, but it keeps sending them to register dialog.
Account Checking
pawn Код:
forward OnAccountCheck(playerid);
public OnAccountCheck(playerid)
{
new rows, fields;
cache_get_data(rows, fields, DB);
if(rows)
{
cache_get_field_content(0, "Name", GetName(playerid), DB, 129);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "In order to play, you need to login", "Login", "Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", "In order to play, you need to register.", "Register", "Quit");
}
return 1;
}