Raised This Month: $51 Target: $400
 12% 

show land with GEOIP


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:         
eisbein
Senior Member
Join Date: Aug 2004
Location: Germany/Rendsburg
Old 09-22-2004 , 08:13   show land with GEOIP
Reply With Quote #1

For AMX Mod X 0.20 with Geoip-Module
__________________
eisbein is offline
Send a message via ICQ to eisbein
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 09-22-2004 , 15:39  
Reply With Quote #2

Don't run this plugin! I have spotted at least two major errors:

Code:
new playerip[17], getcountry[45], country[32][45] public client_connect(id) {   if (!(get_cvar_num("amx_showcountry")))   {     return PLUGIN_CONTINUE   }   get_user_ip(id, playerip, 16, 1)   geoip_country(playerip,getcountry)   country[id] = getcountry   return PLUGIN_CONTINUE }

Can you spot them?


Answers:
* Define country as country[33]* at least. You use id to index it, and an index of 32 would fall outside a 32 sized array (indeces from 0 to 31)
* Max length of country is 45 chars, according to geoip.inc. Therefor you should supply a 46-sized string. getcountry should therefor be getcountry[46]. country should also be country[33][46]. (getcountry is really unnecessary)


I am moving this plugin to trash because these are critical errors. Repost plugin when you've fixed the problems.
Johnny got his gun 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 19:32.


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