AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   amx_who with country, LAN prob (https://forums.alliedmods.net/showthread.php?t=25358)

Zky 03-12-2006 12:01

amx_who with country, LAN prob
 
I have plug-in amx_who with country... but where local IP write error, how to make where 10.x.x.x write LAN ?

I tried so

Code:
if (!equal(userip, "10.")) {     geoip_country(userip, playerloc, 45)     geoip_code2(userip, playerloccode) } else {     playerloc = "LAN"     playerloccode[0] = 0 }

capndurk 03-12-2006 13:11

From what I understand, you're trying to make playerloc = "LAN" if the first three characters of the ip address are "10."

If that's the case, then this is the best way I know how to do that:

Code:
if (userip[0] == '1' && userip[1] == '0' && userip[2] == '.') {     playerloc = "LAN"     playerloccode[0] = 0 } else {     geoip_country(userip, playerloc, 45)     geoip_code2(userip, playerloccode) }

Hopefully that helps you out.

Sandurr 03-12-2006 14:35

Here:

Code:
if (!equal(userip, "10.",3)) {     geoip_country(userip, playerloc, 45)     geoip_code2(userip, playerloccode) } else {     playerloc = "LAN"     playerloccode[0] = 0 }

Zky 03-12-2006 16:02

Quote:

Originally Posted by capndurk
From what I understand, you're trying to make playerloc = "LAN" if the first three characters of the ip address are "10."

If that's the case, then this is the best way I know how to do that:

Code:
if (userip[0] == '1' && userip[1] == '0' && userip[2] == '.') {     playerloc = "LAN"     playerloccode[0] = 0 } else {     geoip_country(userip, playerloc, 45)     geoip_code2(userip, playerloccode) }

Hopefully that helps you out.

thanks, work :)

Quote:

Originally Posted by Sandurr
Here:

Code:
if (!equal(userip, "10.",3)) {     geoip_country(userip, playerloc, 45)     geoip_code2(userip, playerloccode) } else {     playerloc = "LAN"     playerloccode[0] = 0 }

not tested

Sandurr 03-14-2006 10:57

His way is worse than mine

capndurk 03-14-2006 11:14

Quote:

Originally Posted by Sandurr
His way is worse than mine

Way worse, eh? For an extra 20 or so characters of code, mine is way worse? Wow, thanks. You sure know how to make the new guy feel welcome.

Sandurr 03-14-2006 12:03

-.- dun feel like fightning here


All times are GMT -4. The time now is 20:16.

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