SA-MP Forums Archive
help with IP CHECK cmd - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help with IP CHECK cmd (/showthread.php?tid=371077)



help with IP CHECK cmd - NinjaChicken - 22.08.2012

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?


Re: help with IP CHECK cmd - Ranama - 22.08.2012

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. ;(


Re: help with IP CHECK cmd - FalconX - 22.08.2012

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


Re: help with IP CHECK cmd - NinjaChicken - 22.08.2012

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

ok i got that one please help further?


Re: help with IP CHECK cmd - FalconX - 22.08.2012

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;
}



Re: help with IP CHECK cmd - NinjaChicken - 22.08.2012

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