Zobrazit výsledky od 1 do 10 z 10

Téma: Plugin amx_showip

Threaded View

  1. #9
    Administrátor
    Server Admin

    Datum registrace
    Feb 2013
    Umístění
    Praha
    Příspěvky
    9,082

    Odpověď: Plugin amx_showip

    Kód:
    #include <amxmodx>
    #include <amxmisc>
    #include <geoip>
    
    new iPlayers[32], iPlayerNum
    new szName[32], szIP[20], szID[20], szCountry[20]
    
    public plugin_init()
    {
        register_plugin("ShowIP", "1.08", "Spunky")
        register_concmd("amx_ip", "cmd_showall_all")
    }
    
    public cmd_showall_all(id, level, cid)
    {
        get_players(iPlayers, iPlayerNum, "ch")
    
        for (new i = 0; i < iPlayerNum; i++)
        {
            get_user_name(iPlayers[i], szName, 31)
            get_user_ip(iPlayers[i], szIP, 19, 1)
            get_user_authid(iPlayers[i], szID, 19)
            geoip_country(szIP, szCountry, 19)
    
            if ((szIP[0] != '1' && szIP[1] != '9' && szIP[2] != '2') || (szIP[0] != '1' && szIP[1] != '2' && szIP[2] != '7'))
                console_print(id, "^n%s --- IP: %s --- SteamID: %s --- Zeme: %s", szName, szIP, szID, szCountry)
        }
    
        return PLUGIN_HANDLED
    }
    Ještě to můžeš zkusit takhle, to bude ukazovat všechny, ale asi ta podmínka má nějaký smysl:

    Kód:
    #include <amxmodx>
    #include <amxmisc>
    #include <geoip>
    
    new iPlayers[32], iPlayerNum
    new szName[32], szIP[20], szID[20], szCountry[20]
    
    public plugin_init()
    {
        register_plugin("ShowIP", "1.08", "Spunky")
        register_concmd("amx_ip", "cmd_showall_all")
    }
    
    public cmd_showall_all(id, level, cid)
    {
        get_players(iPlayers, iPlayerNum, "ch")
    
        for (new i = 0; i < iPlayerNum; i++)
        {
            get_user_name(iPlayers[i], szName, 31)
            get_user_ip(iPlayers[i], szIP, 19, 1)
            get_user_authid(iPlayers[i], szID, 19)
            geoip_country(szIP, szCountry, 19)
    
    
           // if ((szIP[0] != '1' && szIP[1] != '9' && szIP[2] != '2') || (szIP[0] != '1' && szIP[1] != '2' && szIP[2] != '7'))
                console_print(id, "^n%s --- IP: %s --- SteamID: %s --- Zeme: %s", szName, szIP, szID, szCountry)
        }
    
        return PLUGIN_HANDLED
    }
    Případně je možný, že hráč měl místo steamid "HLTV" (jde nastavit jedním příkazem) a proto se tady nezobrazoval. Takhle to bude ukazovat HLTV i boty:
    Kód:
    #include <amxmodx>
    #include <amxmisc>
    #include <geoip>
    
    new iPlayers[32], iPlayerNum
    new szName[32], szIP[20], szID[20], szCountry[20]
    
    public plugin_init()
    {
        register_plugin("ShowIP", "1.08", "Spunky")
        register_concmd("amx_ip", "cmd_showall_all")
    }
    
    public cmd_showall_all(id, level, cid)
    {
        get_players(iPlayers, iPlayerNum)
    
        for (new i = 0; i < iPlayerNum; i++)
        {
            get_user_name(iPlayers[i], szName, 31)
            get_user_ip(iPlayers[i], szIP, 19, 1)
            get_user_authid(iPlayers[i], szID, 19)
            geoip_country(szIP, szCountry, 19)
    
    
           // if ((szIP[0] != '1' && szIP[1] != '9' && szIP[2] != '2') || (szIP[0] != '1' && szIP[1] != '2' && szIP[2] != '7'))
                console_print(id, "^n%s --- IP: %s --- SteamID: %s --- Zeme: %s", szName, szIP, szID, szCountry)
        }
    
        return PLUGIN_HANDLED
    }
    Naposledy upraveno hofy; 28-02-15 v 14:55.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Pravidla přispívání

  • Nemůžete zakládat témata
  • Nemůžete odpovídat
  • Nemůžete přidávat přílohy
  • Nemůžete upravovat své příspěvky
  •