AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   show_country_connect (https://forums.alliedmods.net/showthread.php?t=171121)

RuRuRu612754 11-02-2011 02:49

show_country_connect
 
Wrote the following code to refer to

http://www.amxmodx.org/funcwiki.php?go=func&id=487
http://www.amxmodx.org/funcwiki.php?go=func&id=154

However, it fails to compile

What do I do?

Code:

#include <amxmodx>
#include <geoip>

public plugin_init()
{
        register_plugin("PLUGIN", "VERSION", "AUTHOR")
}

public client_connect(id)
{
        new name[32]
        new authid[32]
        new ip[]
        new country[]

        get_user_name(id, name, 31)
        get_user_authid(id, authid, 31)
        get_user_ip(id, ip)
        geoip_country(ip[], country)

        client_print(0, print_chat, "%s (%s) has connected to the server from %s", name, authid, country)
}

public client_disconnect(id)
{
        new name[32]
        new authid[32]
        new ip[]
        new country[]

        get_user_name(id, name, 31)
        get_user_authid(id, authid, 31)
        get_user_ip(id, ip)
        geoip_country(ip[], country)

        client_print(0, print_chat, "%s (%s) has disconnected to the server from %s", name, authid, country)
}


drekes 11-02-2011 05:28

Re: show_country_connect
 
PHP Code:

geoip_country(ipcountry


RuRuRu612754 11-02-2011 09:15

Re: show_country_connect
 
drekes

Thanks for answer

However, the error at compile time

Code:

#include <amxmodx>
#include <geoip>

public plugin_init()
{
        register_plugin("PLUGIN", "VERSION", "AUTHOR")
}

public client_connect(id)
{
        new name[32]
        new authid[32]
        new ip[]
        new country[]

        get_user_name(id, name, 31)
        get_user_authid(id, authid, 31)
        get_user_ip(id, ip)
        geoip_country(ip, country)

        client_print(0, print_chat, "%s (%s) has connected to the server from %s", name, authid, country)
}

public client_disconnect(id)
{
        new name[32]
        new authid[32]
        new ip[]
        new country[]

        get_user_name(id, name, 31)
        get_user_authid(id, authid, 31)
        get_user_ip(id, ip)
        geoip_country(ip, country)

        client_print(0, print_chat, "%s (%s) has disconnected to the server from %s", name, authid, country)
}



All times are GMT -4. The time now is 14:19.

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