Thursday, October 18, 2012

GeoIPSAMP - Simple GeoLocation!, Knowing the Player Country

GeoIPSAMP -Simple Geolocation -

- What is?

- To find the country of a player to join the server.

- How it works?

- Sending a request to a website to get the player's country.

- Credits:

- [CRZ]xRicard[O]x.(I, xD)

- ]4[n[T]h0nY]GR[ - Beta Tester.



- Script(no download):


Code:
//Script made by [CRZ]xRicard[O]x.(flomix77@hotmail.com) SA-MP FORUM (Spanish Language).
#include <a_samp>
#include <a_http>

forward LoadCountry(index, response_code, data[]);

public OnPlayerConnect(playerid)
{
     new pIP[30],string[256];//no change this valule.
     GetPlayerIp(playerid, pIP, sizeof(pIP));
     format(string,sizeof(string),"www.GeoIPSAMP.net84.net/geoip/index.php?IP=%s&Licencia=flomix77@hotmail.com",pIP);//Do not delete the license or the script will give an error.
    HTTP(playerid,HTTP_GET,string,"","LoadCountry");
  return 1;
}




public LoadCountry(index, response_code, data[])
{
    new Reply[256];//Do not change the value, or else the country will cut!.
    if(response_code == 200)
    {
        new NamePlayer[MAX_PLAYER_NAME];
        GetPlayerName(index,NamePlayer,sizeof(NamePlayer));
        format(Reply, sizeof(Reply), ".::|| %s Has joined to server. || Country: %s ||::.",NamePlayer,data);
        SendClientMessageToAll(-1,Reply);
    }
    else
    {
        //error getting the country ..
        format(Reply, sizeof(Reply), "Failed to get the Country, error code: %d", response_code);
        printf(Reply);
        //If for some reason tells * obsolete * license msn contact: flomix77@hotmail.com or theme of the script.
    }
}

- Download:


- Click Here!.

P.D: No Mirrors Pliszz!


- Bugs:

- None found, if found please inform me!.

No comments:

Post a Comment