AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [GEOIP] Multiple word countries how to find out.. (https://forums.alliedmods.net/showthread.php?t=46570)

SweatyBanana 10-29-2006 00:59

[GEOIP] Multiple word countries how to find out..
 
I need to find out, when receiving a country with geoip ex: (United States), if it contains more than one word.

Please and thank you?


Would I just do something like this:

PHP Code:

if(containi(txt," ")) 


teame06 10-29-2006 01:41

Re: [GEOIP] Multiple word countries how to find out..
 
Code:
#include <amxmodx> public plugin_init() {     server_print("Matches: United-States %i", HowManyMatches("United-States  United-States U nite d-S tates U nite d-S tates United-States  U nite d-S tates", "United-States"));     server_print("Matches: How %i", HowManyMatches("How Why Where How I went to the mark? How to kill a person?", "How")); } // Not case senstive HowManyMatches(what[], with[]) {     new a, pos, count, len2 = strlen(with), test = strlen(what);     while(pos < test)     {         a = containi(what[pos], with);         if(a == -1)         {             break;         }         pos += len2 + a;         count++;     }     return count; }

Edit:

Wait you mean how many complete words there are? or how many of a certain word?

ie..
1 word United
2 word States

Like that is what you mean?

Silencer123 10-29-2006 04:33

Re: [GEOIP] Multiple word countries how to find out..
 
Now I am afraid! Why does SweatyBanana ask that simple Questions? :O
Code:
if(containi(txt," ")>-1) // Or... if(containi(txt," ") !=-1)

SweatyBanana 10-29-2006 10:17

Re: [GEOIP] Multiple word countries how to find out..
 
Because I am tired and sick. :shock:


All times are GMT -4. The time now is 04:44.

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