Raised This Month: $ Target: $400
 0% 

Help about Country


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Miljan9
Member
Join Date: Dec 2011
Location: Belgrade / Serbia
Old 01-11-2013 , 12:52   Help about Country
Reply With Quote #1

How do I check when a player connect on server whether he is from Serbia, Montenegro, Croatia or bosnia.

I know something about geoip include, but i don't know how to do it.

Sorry from my bad English. Please give me example.
__________________
Hi I'm from Serbian and i don't speak English good.
Miljan9 is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 01-12-2013 , 05:35   Re: Help about Country
Reply With Quote #2

Just do it like:

PHP Code:
    new szIp[32];
    
get_user_ip(idszIpcharsmax(szIp), 1);
    
    new 
szCountry[32];
    
geoip_country(szIpszCountrycharsmax(szCountry));

    
// ... 
Torge is offline
Miljan9
Member
Join Date: Dec 2011
Location: Belgrade / Serbia
Old 01-12-2013 , 10:06   Re: Help about Country
Reply With Quote #3

Hmm, thanks but please give me full example. I don't understand this
__________________
Hi I'm from Serbian and i don't speak English good.
Miljan9 is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 01-12-2013 , 11:43   Re: Help about Country
Reply With Quote #4

Quote:
Originally Posted by Miljan9 View Post
Hmm, thanks but please give me full example. I don't understand this
He did. There are plugins on the forum that does this, just look at them to see how it's done.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Miljan9
Member
Join Date: Dec 2011
Location: Belgrade / Serbia
Old 01-12-2013 , 13:31   Re: Help about Country
Reply With Quote #5

I watched.. but i don't understand good. Please only one example from first post ?
__________________
Hi I'm from Serbian and i don't speak English good.
Miljan9 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-12-2013 , 13:43   Re: Help about Country
Reply With Quote #6

There is no other example to give. Since you are in Scripting Help, you are expected to solve your problems based on the information we give you. Now, we have given you the usage of how to obtain the country of the user, now you have to implement it
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Miljan9
Member
Join Date: Dec 2011
Location: Belgrade / Serbia
Old 01-13-2013 , 05:47   Re: Help about Country
Reply With Quote #7

i understand, but how to make I check if a player from serbia, croatia, bosnia and montenegro :p ?

if(???
__________________
Hi I'm from Serbian and i don't speak English good.
Miljan9 is offline
Schwabba2
Junior Member
Join Date: Jul 2012
Old 01-13-2013 , 05:52   Re: Help about Country
Reply With Quote #8

equal
Schwabba2 is offline
Miljan9
Member
Join Date: Dec 2011
Location: Belgrade / Serbia
Old 01-13-2013 , 17:27   Re: Help about Country
Reply With Quote #9

Please give me full example :p I don't know pawn in this category
__________________
Hi I'm from Serbian and i don't speak English good.
Miljan9 is offline
Old 01-14-2013, 17:41
Miljan9
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
Torge
Veteran Member
Join Date: Oct 2011
Old 01-15-2013 , 11:05   Re: Help about Country
Reply With Quote #10

PHP Code:
new szIp[32];
get_user_ip(idszIpcharsmax(szIp), 1);

new 
szCountry[32];
geoip_country(szIpszCountrycharsmax(szCountry));

new 
szName[32];
get_user_name(idszNamecharsmax(szName));

if (
equal(szCountry"Serbia") || equal(szCountry"Montenegro") || equal(szCountry"Croatia") || equal(szCountry"Bosnia"))
{
   
client_print(0print_chat"%s connected from [%s]."szNameszCountry);


Last edited by Torge; 01-21-2013 at 14:34.
Torge is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:45.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode