28.10.2018, 19:28
Is this what you're looking for?
This is a snippet from my actual gamemode.
PHP код:
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;
}