Поиск Amx_showip with sxgeo

Сообщения
290
Реакции
28
Помог
2 раз(а)
Does anyone know or can create a plugin like this but with sxgeo?:D
Код:
#include < amxmodx > 

#include < amxmisc >

#include < geoip >



#define STR_LEN 32



#define PLUGIN "SHOW IP + LAST IP"

#define VERSION "2.0"

#define AUTHOR "Alka + x"



enum _:Infos

{

gUserIp[ STR_LEN ],

gUserName[ STR_LEN ],

gUserAuthID[ STR_LEN ]

}



new gLastUsers[ 5 ][ Infos ];



#pragma semicolon 1



public plugin_init( )

{

register_plugin( PLUGIN, VERSION, AUTHOR );



register_concmd( "amx_showip", "cmd_showip" );

register_concmd( "amx_last", "cmdLastIp" );

}



public cmd_showip ( id )

{

    if (( get_user_flags ( id ) & ADMIN_SLAY ) )

    {

    console_print( id, "IP-urile prezente pe server sunt:" );

    console_print( id, "------------------------------------------------" );



    new players[ 32 ], num;

    get_players( players, num );



    new i;

    new szCountry[ 20 ];



    for( i=0; i<num; i++ )

    {

        new name[ 32 ];

        new ip[ 32 ];

        new steamid[ 34 ];



        get_user_name( players[ i ], name, 31 );

        get_user_ip( players[ i ], ip, 31, 1 );

        get_user_authid( players[ i ], steamid, 34 );



        geoip_country_ex( ip, szCountry, 19 );



        console_print( id, "   -   %s - %s - %s - %s", name, ip, steamid, szCountry );    

    }



    console_print(id, "-----------------------------------------------");

    }



    return PLUGIN_HANDLED;

}



public cmdLastIp( id )

{

    if (( get_user_flags ( id ) & ADMIN_SLAY ) )

    {

    if( !gLastUsers[ 0 ][ gUserName ][ 0 ] )

    {

        console_print ( id, "[LastIp] Inca nu a iesit nici un jucator de pe server." );



        return 1;

    }



    for( new i = 0; i < 5; i++ )

    {

        if( !gLastUsers [i]  [gUserName] [0] || ! gLastUsers [i] [gUserIp ] [0] || !gLastUsers [i] [gUserAuthID] [0] )

            continue;



        console_print ( id,"%s - %s - %s", gLastUsers [i] [gUserName], gLastUsers [i] [gUserIp], gLastUsers [i] [gUserAuthID] );

    }

    }



    return 1;

}



public client_disconnected( id )

{

    static sName[ 32 ];

    get_user_name( id, sName, sizeof sName - 1 );

    for( new i = 0; i < sizeof gLastUsers; i++ )

    {

        if( equali ( gLastUsers [i] [gUserName], sName ) )

            return 1;

    }



    static iNum;



    get_user_name ( id, gLastUsers [iNum] [gUserName], STR_LEN - 1 );

    get_user_ip ( id, gLastUsers [iNum] [gUserIp], STR_LEN - 1, 1 );

    get_user_authid ( id, gLastUsers [iNum][ gUserAuthID], STR_LEN - 1 );



    iNum++;



    if( iNum >= 5 )



    iNum = 0;



    return 0;

}
 
Сообщения
775
Реакции
293
Помог
11 раз(а)
5 строка, меняем #include < geoip > на #include < sxgeo >
81 строка, меняем new szCountry[ 20 ]; на new szCountry[64], szLanguage[3];
104 строка добавляем get_pcvar_string(get_cvar_pointer("amx_language"), szLanguage, charsmax(szLanguage));
105 строка, меняем geoip_country_ex( ip, szCountry, 19 ); на sxgeo_country(szIP, szCountry, charsmax( szCountry), /*use lang server*/ szLanguage);
 
Сообщения
290
Реакции
28
Помог
2 раз(а)
5 line, change #include <geoip> [/ ICODE] to [ICODE] #include <sxgeo> [/ ICODE]
81 lines, change [ICODE] new szCountry [20]; [/ ICODE] to [ICODE] new szCountry [64], szLanguage [3]; [/ ICODE]
104 строка добавляем [ICODE]get_pcvar_string(get_cvar_pointer("amx_language"), szLanguage, charsmax(szLanguage));

105 строка, меняем geoip_country_ex( ip, szCountry, 19 ); на sxgeo_country(szIP, szCountry, charsmax( szCountry), /*use lang server*/ szLanguage);
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// amx_showip_lastip.sma
//
// D:\Downloads\compiler 190 5249\addons\amxmodx\scripting\amx_showip_lastip.sma(105) : error 017: undefined symbol "szIP"
// D:\Downloads\compiler 190 5249\addons\amxmodx\scripting\amx_showip_lastip.sma(105) : warning 215: expression has no effect
// D:\Downloads\compiler 190 5249\addons\amxmodx\scripting\amx_showip_lastip.sma(105) : warning 215: expression has no effect
// D:\Downloads\compiler 190 5249\addons\amxmodx\scripting\amx_showip_lastip.sma(105) : warning 215: expression has no effect
//
// 1 Error.
// Could not locate output file D:\Downloads\compiler 190 5249\addons\amxmodx\scripting\compiled\amx_showip_lastip.amx (compile failed).
//
// Compilation Time: 0.12 sec
// ----------------------------------------

Press enter to exit ...
 
Сообщения
290
Реакции
28
Помог
2 раз(а)
Plugin can be compiled and seems to be running but it doesnt return ips& countries while typing the command
EDIT:it works,solved.Thank you !
 
Последнее редактирование:

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу