28.10.2018, 18:54
Any example how to make that when I in game write a command /detect ip [ip], and that it searches through mysql database and if finds one or more matching IPs to send client message?
public OnPlayerConnect(playerid)
{
new query[200];
mysql_format(Database, query, sizeof query, "SELECT * FROM `users` WHERE `IP` = '%e'", PlayerIP[playerid]);
mysql_tquery(Database, query, "MultiAccountCheck", "i", playerid);
return 1;
}
forward MultiAccountCheck(playerid);
public MultiAccountCheck(playerid)
{
new string[256];
for(new i; i < cache_num_rows(); i++)
{
if(cache_num_rows() >= 2)
{
TogglePlayerSpectating(playerid, true);
Dialog_Close(playerid);
format(string, sizeof(string), "{FFFFFF}You already have {AA3333}%d accounts{FFFFFF} registred on our database with the actual IP: {AA3333}(%s)", cache_num_rows()-1, PlayerIP[playerid]);
// KickEx(playerid);
Dialog_Show(playerid, MULTIACCOUNT_KICK, DIALOG_STYLE_MSGBOX, "Multi-account detected", string, "OK", "");
}
}
return 1;
}