21.07.2018, 14:31
Hi,
How to check for ex: sandbox'ers, when in one pc players connecting with many accounts?
How to check for ex: sandbox'ers, when in one pc players connecting with many accounts?
public OnPlayerConnect(playerid)
{
new pIP[16],
tIP[16]; // Create strings so we can store the IPs in them
GetPlayerIp(playerid, pIP, sizeof(pIP)); // Get the player's IP
foreach(new i : Player) // Loop through all players
{
if(playerid != i)
{
GetPlayerIp(i, tIP, 16); // Get another player's IP
if(!strcmp(tIP, pIP, true)) // Check if the IPs are the same
{
format(string, sizeof(string), "[WARNING] %s (ID %d) has connected with the same IP as %s (ID %d) (%s)", GetName(playerid), playerid, GetName(i), i, pIP);
SendAdminMessage(COLORDARKRED, string, 1); // Use your function to send the message to admins, I just used my one here.
}
}
}
return 1;
}