19.09.2012, 13:28
Simply call onMySQLCheckAccount with a playerid parameter, and store the id in a global variable.
example
example
pawn Code:
new gSQLid[MAX_PLAYERS];
public MySQLCheckAccount(playerid)
{
new
query[128],
name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
mysql_format(query, sizeof(query), "SELECT id FROM users WHERE `Name` = '%s' LIMIT 1", name);
mysql_function_query(Handel, query, true,"onMySQLCheckAccount", "d", playerid);
return 1;
}
public onMySQLCheckAccount(playerid)
{
new tmp[30];
cache_field_content(0, "id", tmp); // The second parameter here is your field name
gSQLid[playerid] = strval(tmp);
return 1;
}

