CMD:ipcheck(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /ipcheck [playerid]");
if(giveplayerid == INVALID_PLAYER_ID) return 1;
if(IsPlayerConnected(giveplayerid))
{
new playerip[32];
GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
format(string, sizeof(string), "(ID: %d) - (Name: %s) - (IP: %s)", giveplayerid, GetPlayerNameEx(giveplayerid), playerip);
SendClientMessageEx(playerid, COLOR_WHITE, string);
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}
You'll have to get like a table where you see all the countrys and their first ip numbers and make your own country list i think.
This forum requires that you wait 120 seconds between posts. Please try again in 17 seconds. ;( |
CMD:ipcheck(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /ipcheck [playerid]");
if(giveplayerid == INVALID_PLAYER_ID) return 1;
if(IsPlayerConnected(giveplayerid))
{
new playerip[32];
GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
format(string, sizeof(string), "(ID: %d) - (Name: %s) - (IP: %s)", giveplayerid, GetPlayerNameEx(giveplayerid), playerip);
SendClientMessageEx(playerid, COLOR_WHITE, string);
// like this
new szCountry[ 20 ];
GetPlayerCountry( playerid, szCountry, sizeof( szCountry ) );
SendClientMessageEx( playerid, COLOR_WHITE, szCountry );
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}