06.11.2011, 20:51
Example to made auto ip login on mysql ?
new _ip[MAX_PLAYERS], ip[39];
GetPlayerIp(playerid, ip, sizeof(ip));
mysql_query("SELECT ip FROM `tablename` WHERE name = `%s`", name);
mysql_fetch_field_row(_ip[playerid], "ip");
if(_ip[playerid] == ip)
{
// things here
}
new _ip[25], ip[25];
GetPlayerIp(playerid, ip, sizeof(ip));
mysql_query("SELECT ip FROM `tablename` WHERE `name` = '%s'", name);
mysql_fetch_field_row(_ip, "ip");
if(!strcmp(_ip, ip, true)
new ip[25], string[200], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerIp(playerid, ip, sizeof(ip));
format(string, sizeof(string), "UPDATE `tablename` SET `ip`='%s' WHERE `name`='%s'", ip, name);
mysql_query(string);