Код:
public OnAccountCheck(playerid)
{
new str[256];
new rows, fields;
cache_get_data(rows, fields);
if(rows)
{
SendClientMessage(playerid, -1, "Hey,");
}
else
{
}
return 1;
}
stock CheckAccount(playerid)
{
new query[256],escapedPlayerName[MAX_PLAYER_NAME];
mysql_real_escape_string(GetName(playerid), escapedPlayerName);
format(query, sizeof(query), "SELECT * FROM `users` WHERE `name` = '%s' LIMIT 1", escapedPlayerName);
mysql_function_query(dbHandle, query, true, "OnAccountCheck", "d", playerid);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
CheckAccount(playerid);
return 1;
}