SA-MP Forums Archive
[FilterScript] GEO-IP (GeoIp) v3 : Faster & Flexible - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] GEO-IP (GeoIp) v3 : Faster & Flexible (/showthread.php?tid=436115)



GEO-IP (GeoIp) v3.1 RESURRECTED : Faster & Flexible (How-To included) [Last Update : Mar 30, 2015] - abhinavdabral - 10.05.2013



[October 25, 2015] UPDATED!
(DB + New Server)
» PRE-REQUISITES
» STATUS
» WHAT IS IT

I've updated this years old thread as it got some attention randomly. I guess it was buried somewhere and missed some love it deserved. So, even after this project was closed years ago, I resurrected it (sort of) and now you can just simply use the script and don't need to worry about a single thing.

Also, I was sitting, settip up the whole thing for straight 4 hours (out of which, for 2 hours, I was staring at the longest SQL query running of my life), so please be gentle and keep any negative comments to yourself about something that you're getting done for free. If you're not so happy with my server's response, setup your own (tutorial attached).


» WHY? » HOW TO USE / SA-MP PAWN CODE

This is way more simpler than you can imagine. Seriously, I mean it now ... Just do as I say and you'll have GEO-IP Ready and running on your server in no time.

STEP 1
Add this line on the top of your FS/GM (if it's not already there for some reason)
PHP код:
#include <a_http> /// <- Add this include, it's needed to HTTP() function. 
STEP 2
Now add this callback along with all other callbacks :
(feel free to customize format strings and if you are Pawno wizard, customize it even further)

PHP код:
forward GEOIP_HTTPREQUEST(playeridresponse_codelocation[]);
public 
GEOIP_HTTPREQUEST(playeridresponse_codelocation[]) // The GEO-IP Callback.
{
    new 
string[128];
    if(
response_code == 200) {
        new 
Pname[64];
        
GetPlayerName(playerid,Pname,sizeof(Pname));
        
format(stringsizeof(string), ">> %s joined the server from %s",Pname,location);
        
SendClientMessage(playerid0x00CCFFFFstring);
        return 
1;
    }
    else {
        
format(stringsizeof(string), "%d : Request Failed"response_code);
        
SendClientMessage(playerid0xCC9900FFstring);
        return 
0;
    }

STEP 3
Lastly, search for your OnPlayerConnect Callback on your FS/GM and update it. As I mentioned above, you should know a little scripting to see what's going on in here.

PHP код:
public OnPlayerConnect(playerid// Your OnPlayerConnect Callback.
{
    new 
req[256];
    new 
IP[16];
        
GetPlayerIp(playerid,IP,sizeof(IP));
    
// format(IP,sizeof(IP),"117.56.0.98"); //Un-comment this line if you want to put some random Dummy IP to test the script
    
if(strlen(IP)<1) return 1;
    
format(reqsizeof(req),"geoip.cybernieve.com/?IP=%s",IP); //// Replace the address (geoip.cybernieve.com) if you've setup your own GEO-IP Server
    
HTTP(playeridHTTP_GETreq,"","GEOIP_HTTPREQUEST");
    return 
1;


» TUTORIAL (only if you want your own GEP-IP Web Server)


See Attachment section


» SUPPORT AND LICENSE

This is a free thing. Use it, modify it, But don't sell it by your name OR even my name on it. Keep it free. Maybe develop it further (find ways to make it faster, maybe?). If you do that, don't forget to mention my name for the BASE set-up, or the idea, whatever. It's not something NEW, but for me, it definitely is an achievement.

Comments are welcomed. REP++ me if you find this thing helpful. But, I don't think I'm going to work more on this.


» CREDITS

Me (Abhinav Dabral [CODE Wave]) for the whole thing | fb.me/CodeWave
Database : db-ip.com

-X-X-X-X--- (Update : March 30, 2015) This Project will remain closed as I think it's perfect now (as a base). If someone wants to mix in their own ideas, they are free to do so. As for this one, script is working, everything is working. I've setup new server so that's also working. I'll update the IP Database, someday maybe if needed but otherwise there is nothing more to this. Read the attached documentation if you want to setup your own server. ---X-X-X-X-



Re: GEO-IP (GeoIp) v3 : Faster & Flexible - nGen.SoNNy - 10.05.2013

I think i will use this geopip again xD


Re: GEO-IP (GeoIp) v3 : Faster & Flexible - RedCrossER - 10.05.2013

Good Work, Upload those files will get evaded with this, Good idea.


Re: GEO-IP (GeoIp) v3 : Faster & Flexible - iFear - 10.05.2013

Awesome Work buddy


Re: GEO-IP (GeoIp) v3 : Faster & Flexible - Xport6050 - 10.05.2013

awesome


Re: GEO-IP (GeoIp) v3 : Faster & Flexible - Edvin - 10.05.2013

Lawl, this is really very good version of Geo IP. I'll use it, and i think i will use this version, not others what use databases.


Re: GEO-IP (GeoIp) v3 : Faster & Flexible - $mooth - 10.05.2013

Well done.


Re: GEO-IP (GeoIp) v3 : Faster & Flexible - x96664 - 10.05.2013

Awesome !


Respuesta: GEO-IP (GeoIp) v3 : Faster & Flexible - Matyaas - 11.05.2013

Код:
C:\Users\yessica\Desktop\Carpetas\WEAPON_SCROLL_MOD_2_0_BETA\Gran-Destruccion 2.0\filterscripts\ladmin.pwn(1235) : error 017: undefined symbol "HTTP"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Respuesta: GEO-IP (GeoIp) v3 : Faster & Flexible - abhinavdabral - 11.05.2013

Quote:
Originally Posted by Matyaas
Посмотреть сообщение
Код:
C:\Users\yessica\Desktop\Carpetas\WEAPON_SCROLL_MOD_2_0_BETA\Gran-Destruccion 2.0\filterscripts\ladmin.pwn(1235) : error 017: undefined symbol "HTTP"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Seriously dude ? Are you kidding me ? .....

Add the "a_http" library. *Facepalm*

Код:
#include <a_http>