02.04.2015, 20:10
I am looking to make a command that lists all the usernames that are associated to an IP
How would I do it, would I do something like:
I've been looking for a way to do this for a while and I haven't quite found any tutorials for what I've been looking for, if anyone could please help with this I would be grateful for any help.
How would I do it, would I do something like:
pawn Код:
(Take the string IP as if it were being entered in a sscanf param)
new query[128], ip[24], buffer[MAX_PLAYER_NAME];
format(query, sizeof(query),"SELECT `Username` FROM `Accounts` WHERE `IP` = '%s'", ip);
mysql_query(query);
mysql_store_result();
new rows = mysql_num_rows();
if(rows < 0) {
SendClientMessage(playerid, COLOR_GREEN,"Accoutns Associated with that IP:");
while(mysql_retrieve_row())
{
mysql_fetch_field_row(buffer, "Username"); sendClientMessageEx(playerid, COLOR_WHITE,"%s", buffer);
}
}
mysql_free_result();
I've been looking for a way to do this for a while and I haven't quite found any tutorials for what I've been looking for, if anyone could please help with this I would be grateful for any help.