02.07.2016, 08:42
Hello,
MySQL : R34
Log :
MySQL : R34
Log :
pawn Код:
[13:03:29] CheckAccount IS OK !
[13:03:29] OnAccountCheck IS OK !
[13:03:29] Get rows is OK! rows : - fields :
[13:03:29] pSQLid : - pPass :
pawn Код:
stock CheckAccount(playerid)
{
new query[82];
printf("CheckAccount IS OK !");
format(query, sizeof(query), "SELECT id, Password FROM `users` WHERE `Username` = '%s'", returnName(playerid));
mysql_function_query(1, query, true, "OnAccountCheck", "d", playerid);
return 1;
}
pawn Код:
forward OnAccountCheck(playerid);
public OnAccountCheck(playerid)
{
printf("OnAccountCheck IS OK !");
if(playerid != INVALID_PLAYER_ID)
{
new rows, fields;
cache_get_data(rows, fields);
printf("Get rows is OK! rows : %s - fields : %s",rows,fields);
if(rows)
{
Player[playerid][pSQLid] = cache_get_row_int(0, 0);
cache_get_row(0, 3, Player[playerid][pPass], 1, 130);
printf("pSQLid : %s - pPass : %s",Player[playerid][pSQLid],Player[playerid][pPass]);
ShowLoginScreen(playerid);
}
else
{
ShowRegisterScreen(playerid);
}
}
return 1;
}