Amx lastip si showip

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
HBK2310
Membru, skill +1
Membru, skill +1
Posts: 345
Joined: 30 Oct 2009, 21:38
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Detinator server CS: dr.fullplay.ro
Has thanked: 3 times
Been thanked: 5 times

19 Dec 2013, 01:24

Merge facut din 2in1 iar la comenzile amx_showip si amx_last sa aibe acces toti playerii?

Code: Select all

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Last IP"
#define VERSION "1.0"
#define AUTHOR "Alka"

#define STR_LEN 32
enum _:Infos
{

gUserIp[STR_LEN],
gUserName[STR_LEN]
}

new gLastUsers[5][Infos];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_lastip", "cmdLastIp", ADMIN_ADMIN, "");

}
public cmdLastIp(id,level,cid)
{

if ( ! cmd_access ( id , level , cid , 1 ) )
return PLUGIN_HANDLED

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

client_print(id,3,"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])
continue;
console_print(id,"%s - %s",gLastUsers[i][gUserName], gLastUsers[i][gUserIp]);
}

return 1;

}
public client_disconnect(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);
iNum++;

if(iNum >= 5)
iNum = 0;

return 0;

}

Code: Select all

#include <amxmodx>
#include <amxmisc>

new gPcvar;

public plugin_init() {
    
    register_plugin("Show IP Advanced", "0.2", "eXtreamCS Team") 
    
    register_clcmd("amx_showip", "cmdShowIp", -1);
    
    gPcvar = register_cvar("amx_showip_admins", "0");
} 

public cmdShowIp(id) 
{ 
    console_print(id, "Nume jucator - IP");
    console_print(id, "---------------------------");
    
    new players[32], num;
    get_players(players, num);
    
    for(new i = 0 ; i < num ; i++) 
    { 
        new name[32] ; 
        new ipeki[32];
        get_user_name(players[i], name, 31)
        get_user_ip(players[i], ipeki, 31, 1);
        
        if(is_user_admin(players[i]) && !get_pcvar_num(gPcvar))
            console_print(id, "%s", name);
        else
            console_print(id, "%s  -  %s", name, ipeki);
    }
    console_print(id, "---------------------------");
    
    return 1;
} 
Rapidserver
User avatar
CsN^ ;x
Membru eXtream
Membru eXtream
Posts: 3559
Joined: 02 Apr 2012, 15:58
Detinator Steam: Nu
CS Status: Retras din domeniul Counter-Strike
Reputatie: Fost moderator
Location: Bucuresti
Has thanked: 796 times
Been thanked: 607 times

19 Dec 2013, 10:32

| Afiseaza codul
[code]#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 ]
}

new gLastUsers[ 5 ][ Infos ];

#pragma semicolon 1

public plugin_init( )
{
   register_plugin( PLUGIN, VERSION, AUTHOR );

   register_concmd( "amx_showip", "cmd_showip", ADMIN_KICK );
   register_concmd( "amx_lastip", "cmdLastIp", ADMIN_ADMIN );
}

public cmd_showip( id )
{
   console_print( id, "IP-urile prezente pe server-ul DR.LEGENDCS.COM:" );
   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( ip, szCountry, 19 );

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

   }

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

   return PLUGIN_HANDLED;
}

public cmdLastIp( id, level, cid )
{

    if ( !cmd_access ( id , level , cid , 1 ) )

    return PLUGIN_HANDLED;

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

    {

    client_print( id, 3, "Inca nu a iesit nici un jucator de pe server-ul DR.LEGENDCS.COM!" );

    return 1;

    }

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

    {

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

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

    }

    return 1;

}

public client_disconnect( 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 );

     iNum++;

     if( iNum >= 5 )

     iNum = 0;

     return 0;
}[/code]
Addons HNS level,gravity,xp DOWNLOAD ( e țeapă)
https://5filme.com/ - un simplu site de filme pentru timpul liber
User avatar
HBK2310
Membru, skill +1
Membru, skill +1
Posts: 345
Joined: 30 Oct 2009, 21:38
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Detinator server CS: dr.fullplay.ro
Has thanked: 3 times
Been thanked: 5 times

19 Dec 2013, 11:21

E bun doar ca la amx_lastip nu merge si pentru playeri, doar pentru admini.
User avatar
CsN^ ;x
Membru eXtream
Membru eXtream
Posts: 3559
Joined: 02 Apr 2012, 15:58
Detinator Steam: Nu
CS Status: Retras din domeniul Counter-Strike
Reputatie: Fost moderator
Location: Bucuresti
Has thanked: 796 times
Been thanked: 607 times

19 Dec 2013, 13:40

HBK2310 wrote:E bun doar ca la amx_lastip nu merge si pentru playeri, doar pentru admini.
| Afiseaza codul
[code]#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 ]
}

new gLastUsers[ 5 ][ Infos ];

#pragma semicolon 1

public plugin_init( )
{
   register_plugin( PLUGIN, VERSION, AUTHOR );

   register_concmd( "amx_showip", "cmd_showip", ADMIN_KICK );
   register_concmd( "amx_lastip", "cmdLastIp", ADMIN_USER );
}

public cmd_showip( id )
{
   console_print( id, "IP-urile prezente pe server-ul DR.LEGENDCS.COM:" );
   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( ip, szCountry, 19 );

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

   }

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

   return PLUGIN_HANDLED;
}

public cmdLastIp( id, level, cid )
{

    if ( !cmd_access ( id , level , cid , 1 ) )

    return PLUGIN_HANDLED;

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

    {

    client_print( id, 3, "Inca nu a iesit nici un jucator de pe server-ul DR.LEGENDCS.COM!" );

    return 1;

    }

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

    {

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

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

    }

    return 1;

}

public client_disconnect( 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 );

     iNum++;

     if( iNum >= 5 )

     iNum = 0;

     return 0;
}[/code]
Daca vrei sa schimbi accesele la comenzii,le schimbii de
aici | Afiseaza codul
register_concmd( "amx_showip", "cmd_showip", ADMIN_KICK );
   register_concmd( "amx_lastip", "cmdLastIp", ADMIN_USER  );
cu care vrei tu de
aici | Afiseaza codul
#define ADMIN_ALL		0	//Everyone
#define ADMIN_IMMUNITY		1	//Flag "a", immunity
#define ADMIN_RESERVATION	2	//Flag "b", reservation
#define ADMIN_KICK		4	//Flag "c", kick
#define ADMIN_BAN		8	//Flag "d", ban
#define ADMIN_SLAY		16	//Flag "e", slay
#define ADMIN_MAP		32	//Flag "f", map change
#define ADMIN_CVAR		64	//Flag "g", cvar change
#define ADMIN_CFG		128	//Flag "h", config execution
#define ADMIN_CHAT		256	//Flag "i", chat
#define ADMIN_VOTE		512	//Flag "j", vote
#define ADMIN_PASSWORD		1024	//Flag "k", sv_password
#define ADMIN_RCON		2048	//Flag "l", rcon access
#define ADMIN_LEVEL_A		4096	//Flag "m", custom
#define ADMIN_LEVEL_B		8192	//Flag "n", custom
#define ADMIN_LEVEL_C		16384	//Flag "o", custom
#define ADMIN_LEVEL_D		32768	//Flag "p", custom
#define ADMIN_LEVEL_E		65536	//Flag "q", custom
#define ADMIN_LEVEL_F		131072	//Flag "r", custom
#define ADMIN_LEVEL_G		262144	//Flag "s", custom
#define ADMIN_LEVEL_H		524288	//Flag "t", custom
#define ADMIN_MENU		1048576	//Flag "u", menus
#define ADMIN_ADMIN		16777216	//Flag "y", default admin
#define ADMIN_USER		33554432	//Flag "z", default user
Addons HNS level,gravity,xp DOWNLOAD ( e țeapă)
https://5filme.com/ - un simplu site de filme pentru timpul liber
User avatar
HBK2310
Membru, skill +1
Membru, skill +1
Posts: 345
Joined: 30 Oct 2009, 21:38
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Detinator server CS: dr.fullplay.ro
Has thanked: 3 times
Been thanked: 5 times

27 Jun 2014, 14:21

Cand scriu amx_last imi arata ip-urile, dar cum pot sa adaug pana un ip-uri si dupa sa arate asa:
===================
nume
nume
===================

Ceva de genu'.
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests