23.04.2011, 08:50
GStylez MYSQL plugin:
Top of the script:
Somewhere else:
not tested.
Top of the script:
pawn Код:
new
id[MAX_PLAYERS],
belongsto[MAX_PLAYERS],
contactname[MAX_PLAYERS],
contactnumber[MAX_PLAYERS];
pawn Код:
new query[128], playername[MAX_PLAYER_NAME], result[128];
GetPlayerName(playerid, playername, sizeof(playername));
format(query, sizeof(query), "SELECT * FROM `yourtable` WHERE `belongs_to` = '%s'", playername); // I assume belongs_to is the field of the guy who's typing the command to view his contact list.
mysql_query(query);
mysql_store_result();
if(mysql_fetch_row_format(result))
{
sscanf(result, "is[24]s[24]i", id[playerid], belongsto[playerid], contactname[playerid], contactnumber[playerid]);
}
mysql_free_result();