help with IP CHECK cmd
#1

ok i have this cmd
pawn Код:
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;
}
can someone edit it so like i do it but underneath the ip it gives the location such as philipines or whatever?
Reply
#2

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. ;(
Reply
#3

Quote:
Originally Posted by Ranama
Посмотреть сообщение
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. ;(
For location you need geoip plugin or include, you can look on the following threads and choose what you want..

https://sampforum.blast.hk/showthread.php?tid=296171

-----

https://sampforum.blast.hk/showthread.php?tid=32509

-----

https://sampforum.blast.hk/showthread.php?tid=190699
Reply
#4

https://sampforum.blast.hk/showthread.php?tid=296171

ok i got that one please help further?
Reply
#5

You have to include that on the top of your script then..

pawn Код:
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;
}
Reply
#6

for some reason the database link is dead it just goes to nothing
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)