AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help about Country (https://forums.alliedmods.net/showthread.php?t=205517)

Miljan9 01-11-2013 12:52

Help about Country
 
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.

Torge 01-12-2013 05:35

Re: Help about Country
 
Just do it like:

PHP Code:

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

    
// ... 


Miljan9 01-12-2013 10:06

Re: Help about Country
 
Hmm, thanks but please give me full example. I don't understand this :)

wickedd 01-12-2013 11:43

Re: Help about Country
 
Quote:

Originally Posted by Miljan9 (Post 1872133)
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.

Miljan9 01-12-2013 13:31

Re: Help about Country
 
I watched.. but i don't understand good. Please only one example from first post :) ?

YamiKaitou 01-12-2013 13:43

Re: Help about Country
 
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

Miljan9 01-13-2013 05:47

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

if(???

Schwabba2 01-13-2013 05:52

Re: Help about Country
 
equal

Miljan9 01-13-2013 17:27

Re: Help about Country
 
Please give me full example :p I don't know pawn in this category

Torge 01-15-2013 11:05

Re: Help about Country
 
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);




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

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