Raised This Month: $ Target: $400
 0% 

[Solved]Simple code to detect country


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
eXist
Member
Join Date: Apr 2005
Old 09-06-2007 , 22:15   [Solved]Simple code to detect country
Reply With Quote #1

*EDIT* I know there are a lot of plugins that do similar things, but I decided to write my own because I disliked many of the current ones. Also, it helps me learn small .

Still learning, but I'm working on code to detect, then display a users country based on say input from a user. It is just for fun, but I would like to get it functioning.

For example: A user types '/country playername' in all chat, then I want it to display the user country to everyone. I guess I'm still retarded cause I can't get it to work .

Code:
#include <amxmodx> #include <amxmisc> #include <geoip> public plugin_init() {     register_plugin("Show Country","1.0","eXist`")     register_clcmd("say /country","showCountry",0,"Shows a users Country") } public showCountry(id) {     //Checks for flags m or s :: I know its weird, don't ask :D.     if((get_user_flags(id) & ADMIN_LEVEL_A) || (get_user_flags(id) & ADMIN_LEVEL_G)){         new args[128], name[33], target, userip[17], usercountry[46], msg[128]         read_argv(2,args,127)                 target = cmd_target(id,args,2)                 get_user_name(target,name,32)         get_user_ip(target,userip,16,1)         geoip_country(userip,usercountry,45)                 set_hudmessage(255,255,255,-1.0,0.35,0,6.0,12.0,0.1,0.2,4)         format(msg,127,"%s is from %s",name,usercountry)         show_hudmessage(0,msg)          } }

Last edited by eXist; 09-07-2007 at 23:30. Reason: Solved
eXist is offline
 



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 16:12.


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