Raised This Month: $ Target: $400
 0% 

amx_who with country, LAN prob


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zky
Member
Join Date: Nov 2005
Old 03-12-2006 , 12:01   amx_who with country, LAN prob
Reply With Quote #1

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 }
Zky is offline
capndurk
Senior Member
Join Date: Feb 2006
Old 03-12-2006 , 13:11  
Reply With Quote #2

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.
capndurk is offline
Sandurr
Senior Member
Join Date: Aug 2005
Old 03-12-2006 , 14:35  
Reply With Quote #3

Here:

Code:
if (!equal(userip, "10.",3)) {     geoip_country(userip, playerloc, 45)     geoip_code2(userip, playerloccode) } else {     playerloc = "LAN"     playerloccode[0] = 0 }
Sandurr is offline
Zky
Member
Join Date: Nov 2005
Old 03-12-2006 , 16:02  
Reply With Quote #4

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
Zky is offline
Sandurr
Senior Member
Join Date: Aug 2005
Old 03-14-2006 , 10:57  
Reply With Quote #5

His way is worse than mine
Sandurr is offline
capndurk
Senior Member
Join Date: Feb 2006
Old 03-14-2006 , 11:14  
Reply With Quote #6

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.
capndurk is offline
Sandurr
Senior Member
Join Date: Aug 2005
Old 03-14-2006 , 12:03  
Reply With Quote #7

-.- dun feel like fightning here
Sandurr 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 20:16.


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