21.07.2013, 10:52
You can do it this way;
If you want to do it the 'old' way, without CheckAccount callback, you can try y_inline which is supported in R31.
pawn Code:
CheckAccountExists(account[])
{
new string[128];
format(string, sizeof(string), "SELECT * FROM player_accounts WHERE Name = '%s'", account);
mysql_function_query(dbHandle, string, true, "CheckAccount", "s", account);
}
forward CheckAccount(account[]);
public CheckAccount(account[])
{
new rows, fields;
cache_get_data(rows, fields);
if(!rows)
{
// account does not exist, register?
}
else
{
//proceed to login?
}
return 1; // To clear cache
}