Discord sunucumuz açılmıştır, hepinizi bekleriz

https://discord.gg/43gGDQe6tS

Bu plugini düzenleyebilir misiniz?

Eklenti sorunlarınız ve özel eklenti istekleriniz

Moderatör: Moderatörler


Konu Sahibi
CssAttack
Mesajlar: 48
Kayıt: Prş Şub 16, 2017 9:50 am

Bu plugini düzenleyebilir misiniz?

Mesaj gönderen CssAttack »

Kolay gelsin herkese. Öncelikle amxmodx i geliştirenleri falan githubdan takip ediyorum o sırada yakın zamanda hamsandwichde derlenmiş bu afk slay ve kickere denk geldim. Derlemeye çalışırken bu aşağıdaki sorun çıktı ne yapmamı önerirsiniz bu konuda?


Kod: Tümünü seç

#include < amxmodx >
#include < cstrike >
#include < fakemeta >
#include < hamsandwich >
#include < chatcolor >

#define KICK_TIME     60
#define ANNOUNCE_TIME 45

#define SetAfkOnce(%1)   ( g_bWasAfkOnce |=    1 << ( %1 & 31 ) )
#define ClearAfkOnce(%1) ( g_bWasAfkOnce &= ~( 1 << ( %1 & 31 ) ) )
#define WasAfkOnce(%1)   ( g_bWasAfkOnce &     1 << ( %1 & 31 ) )

#define UpdateUserLastActivity(%1)	set_pdata_float( %1, 124, get_gametime( ), 5 )
// cs_set_user_lastactivity( %1, get_gametime( ) )
#define IsInTeam(%1)    ( CS_TEAM_T <= cs_get_user_team( %1 ) <= CS_TEAM_CT )
#define IsUserAdmin(%1) ( get_user_flags( %1 ) & ADMIN_KICK )

new Float:g_vAngles[ 33 ][ 3 ];
new g_iThinkingEnt, g_iHudSync, g_iIgnoreFirst, g_bWasAfkOnce;
new Trie:g_tAutoCmds;

public plugin_init( ) {
	register_plugin( "AFK", "1.0", "xPaw" );
	
	g_iHudSync = CreateHudSyncObj( );
	
	register_event( "HLTV", "EventNewRound", "a", "1=0", "2=0" );
	
	new szClassName[ 2 ];
	g_iThinkingEnt = get_maxplayers( ) + 1;
	
	while( pev_valid( g_iThinkingEnt ) && g_iThinkingEnt < 100 ) {
		pev( g_iThinkingEnt, pev_classname, szClassName, 1 );
		
		if( szClassName[ 0 ] == 0 )
			break;
		
		g_iThinkingEnt++;
	}
	
	RegisterHamFromEntity( Ham_Think, g_iThinkingEnt, "FwdThink", 1 );
	RegisterHam( Ham_Spawn, "player", "FwdHamPlayerSpawn", 1 );
	
	g_tAutoCmds = TrieCreate( );
	
	TrieSetCell( g_tAutoCmds, "vban", 1 );
	TrieSetCell( g_tAutoCmds, "specmode", 1 );
	TrieSetCell( g_tAutoCmds, "spec_set_ad", 1 );
	TrieSetCell( g_tAutoCmds, "VModEnable", 1 );
	TrieSetCell( g_tAutoCmds, "client_buy_close", 1 );
}

public plugin_end( )
	TrieDestroy( g_tAutoCmds );

public client_putinserver( id ) {
	UpdateUserLastActivity( id );
	ClearAfkOnce( id );
}

public client_command( id ) {
	new szCommand[ 13 ];
	read_argv( 0, szCommand, 12 );
	
	if( !TrieKeyExists( g_tAutoCmds, szCommand ) )
		UpdateUserLastActivity( id );
}

public EventNewRound( )
	g_iIgnoreFirst = 16; // ~5 seconds

public FwdHamPlayerSpawn( const id ) {
	if( is_user_alive( id ) ) {
		pev( id, pev_v_angle, g_vAngles[ id ] );
		
		UpdateUserLastActivity( id );
	}
}

public FwdThink( const iEntity ) {
	if( iEntity != g_iThinkingEnt || g_iIgnoreFirst-- > 0 )
		return;
	
	static Float:flGametime, Float:flLastCheck; flGametime = get_gametime( );
	
	if( flLastCheck > flGametime )
		return;
	
	flLastCheck = flGametime + 1.0;
	
	static iPlayers[ 32 ], iNum;
	get_players( iPlayers, iNum, "ach" );
	
//	if( iNum < 6 )
//		return;
	
	static i, id, Float:flLastActivity, Float:vAngles[ 3 ];
	
	for( i = 0; i < iNum; i++ ) {
		id = iPlayers[ i ];
		
		if( !IsInTeam( id ) )
			continue;
		
		pev( id, pev_v_angle, vAngles );
		
		if( vAngles[ 0 ] != g_vAngles[ id ][ 0 ] || vAngles[ 1 ] != g_vAngles[ id ][ 1 ] ) {
			UpdateUserLastActivity( id );
			g_vAngles[ id ][ 0 ] = vAngles[ 0 ];
			g_vAngles[ id ][ 1 ] = vAngles[ 1 ];
			
			continue;
		}
		
		flLastActivity = ( flGametime - cs_get_user_lastactivity( id ) );
		
		if( flLastActivity >= KICK_TIME )
			PunishPlayer( id );
		else if( flLastActivity >= ANNOUNCE_TIME ) {
			set_hudmessage( 0, 100, 255, -1.0, 0.4, 0, 0.0, 1.0, 0.1, 0.1 );
			ShowSyncHudMsg( id, g_iHudSync, "You have %i seconds to move", floatround( KICK_TIME - flLastActivity ) );
		}
	}
}

PunishPlayer( const id ) {
	new szName[ 32 ];
	get_user_name( id, szName, 31 );
	
	if( !WasAfkOnce( g_bWasAfkOnce, id ) ) {
		SetAfkOnce( id );
		
		user_kill( id );
		
		set_hudmessage( 0, 100, 255, -1.0, 0.4, 0, 0.0, 3.5, 0.1, 0.4 );
		ShowSyncHudMsg( id, g_iHudSync, "You have been killed for being away from keyboard" );
		
		ColorChat( 0, Red, "[ mY.RuN ]^4 %s^1 has been killed for being away from keyboard.", szName );
	} else {
		if( IsUserAdmin( id ) ) {
			user_kill( id );
			cs_set_user_team( id, CS_TEAM_SPECTATOR );
		} else {
			server_cmd( "kick #%i You has been kicked for being away from keyboard", get_user_userid( id ) );
			
			ColorChat( 0, Red, "[ mY.RuN ]^4 %s^1 has been kicked from the server for being away from keyboard.", szName );
		}
	}
}



Derlemedeki hata;

Kod: Tümünü seç

Sonuç
Eklenti derleme sonucu aşağıdaki gibidir; 
AMX Mod X Compiler 1.8.3-dev+5079
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

/home/araclar/compiler/include/chatcolor.inc(37) : error 021: symbol already defined: "client_print_color"

1 Error.
Could not locate output file /home/csserverlar/213.238.173.245-cs245com/cstrike/addons/amxmodx/plugins/afkx.amx (compile failed).

Link:
Linklerini gizle
Linki Kopyala

PaZee
Mesajlar: 1761
Kayıt: Çrş Şub 22, 2017 11:28 pm
Konum: Istanbul
Server Ip/DNS: Cs.teknoklan.com
Clan İsmi: TeknoKlan
İletişim:

Bu plugini düzenleyebilir misiniz?

Mesaj gönderen PaZee »

chatcolor inc sildim

colorchat enumu ekledim.

Kod: Tümünü seç

#include < amxmodx >
#include < cstrike >
#include < fakemeta >
#include < hamsandwich >

#define KICK_TIME     60
#define ANNOUNCE_TIME 45

#define SetAfkOnce(%1)   ( g_bWasAfkOnce |=    1 << ( %1 & 31 ) )
#define ClearAfkOnce(%1) ( g_bWasAfkOnce &= ~( 1 << ( %1 & 31 ) ) )
#define WasAfkOnce(%1)   ( g_bWasAfkOnce &     1 << ( %1 & 31 ) )

#define UpdateUserLastActivity(%1)   set_pdata_float( %1, 124, get_gametime( ), 5 )
// cs_set_user_lastactivity( %1, get_gametime( ) )
#define IsInTeam(%1)    ( CS_TEAM_T <= cs_get_user_team( %1 ) <= CS_TEAM_CT )
#define IsUserAdmin(%1) ( get_user_flags( %1 ) & ADMIN_KICK )




enum Color
{
    NORMAL = 1, // clients scr_concolor cvar color
    GREEN, // Green Color
    TEAM_COLOR, // Red, grey, blue
    GREY, // grey
    RED, // Red
    BLUE, // Blue
}

new TeamName[][] = 
{
    "",
    "TERRORIST",
    "CT",
    "SPECTATOR"
}

ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
    static message[256];

    switch(type)
    {
        case NORMAL: // clients scr_concolor cvar color
        {
            message[0] = 0x01;
        }
        case GREEN: // Green
        {
            message[0] = 0x04;
        }
        default: // White, Red, Blue
        {
            message[0] = 0x03;
        }
    }

    vformat(message[1], 251, msg, 4);

    // Make sure message is not longer than 192 character. Will crash the server.
    message[192] = '^0';

    static team, ColorChange, index, MSG_Type;
    
    if(id)
    {
        MSG_Type = MSG_ONE;
        index = id;
    } else {
        index = FindPlayer();
        MSG_Type = MSG_ALL;
    }
    
    team = get_user_team(index);
    ColorChange = ColorSelection(index, MSG_Type, type);

    ShowColorMessage(index, MSG_Type, message);
        
    if(ColorChange)
    {
        Team_Info(index, MSG_Type, TeamName[team]);
    }
}

ShowColorMessage(id, type, message[])
{
    message_begin(type, get_user_msgid("SayText"), _, id);
    write_byte(id)        
    write_string(message);
    message_end();    
}

Team_Info(id, type, team[])
{
    message_begin(type, get_user_msgid("TeamInfo"), _, id);
    write_byte(id);
    write_string(team);
    message_end();

    return 1;
}

ColorSelection(index, type, Color:Type)
{
    switch(Type)
    {
        case RED:
        {
            return Team_Info(index, type, TeamName[1]);
        }
        case BLUE:
        {
            return Team_Info(index, type, TeamName[2]);
        }
        case GREY:
        {
            return Team_Info(index, type, TeamName[0]);
        }
    }

    return 0;
}

FindPlayer()
{
    static i;
    i = -1;

    while(i <= get_maxplayers())
    {
        if(is_user_connected(++i))
        {
            return i;
        }
    }

    return -1;
} 

new Float:g_vAngles[ 33 ][ 3 ];
new g_iThinkingEnt, g_iHudSync, g_iIgnoreFirst, g_bWasAfkOnce;
new Trie:g_tAutoCmds;

public plugin_init( ) {
   register_plugin( "AFK", "1.0", "xPaw" );
   
   g_iHudSync = CreateHudSyncObj( );
   
   register_event( "HLTV", "EventNewRound", "a", "1=0", "2=0" );
   
   new szClassName[ 2 ];
   g_iThinkingEnt = get_maxplayers( ) + 1;
   
   while( pev_valid( g_iThinkingEnt ) && g_iThinkingEnt < 100 ) {
      pev( g_iThinkingEnt, pev_classname, szClassName, 1 );
      
      if( szClassName[ 0 ] == 0 )
         break;
      
      g_iThinkingEnt++;
   }
   
   RegisterHamFromEntity( Ham_Think, g_iThinkingEnt, "FwdThink", 1 );
   RegisterHam( Ham_Spawn, "player", "FwdHamPlayerSpawn", 1 );
   
   g_tAutoCmds = TrieCreate( );
   
   TrieSetCell( g_tAutoCmds, "vban", 1 );
   TrieSetCell( g_tAutoCmds, "specmode", 1 );
   TrieSetCell( g_tAutoCmds, "spec_set_ad", 1 );
   TrieSetCell( g_tAutoCmds, "VModEnable", 1 );
   TrieSetCell( g_tAutoCmds, "client_buy_close", 1 );
}

public plugin_end( )
   TrieDestroy( g_tAutoCmds );

public client_putinserver( id ) {
   UpdateUserLastActivity( id );
   ClearAfkOnce( id );
}

public client_command( id ) {
   new szCommand[ 13 ];
   read_argv( 0, szCommand, 12 );
   
   if( !TrieKeyExists( g_tAutoCmds, szCommand ) )
      UpdateUserLastActivity( id );
}

public EventNewRound( )
   g_iIgnoreFirst = 16; // ~5 seconds

public FwdHamPlayerSpawn( const id ) {
   if( is_user_alive( id ) ) {
      pev( id, pev_v_angle, g_vAngles[ id ] );
      
      UpdateUserLastActivity( id );
   }
}

public FwdThink( const iEntity ) {
   if( iEntity != g_iThinkingEnt || g_iIgnoreFirst-- > 0 )
      return;
   
   static Float:flGametime, Float:flLastCheck; flGametime = get_gametime( );
   
   if( flLastCheck > flGametime )
      return;
   
   flLastCheck = flGametime + 1.0;
   
   static iPlayers[ 32 ], iNum;
   get_players( iPlayers, iNum, "ach" );
   
//   if( iNum < 6 )
//      return;
   
   static i, id, Float:flLastActivity, Float:vAngles[ 3 ];
   
   for( i = 0; i < iNum; i++ ) {
      id = iPlayers[ i ];
      
      if( !IsInTeam( id ) )
         continue;
      
      pev( id, pev_v_angle, vAngles );
      
      if( vAngles[ 0 ] != g_vAngles[ id ][ 0 ] || vAngles[ 1 ] != g_vAngles[ id ][ 1 ] ) {
         UpdateUserLastActivity( id );
         g_vAngles[ id ][ 0 ] = vAngles[ 0 ];
         g_vAngles[ id ][ 1 ] = vAngles[ 1 ];
         
         continue;
      }
      
      flLastActivity = ( flGametime - cs_get_user_lastactivity( id ) );
      
      if( flLastActivity >= KICK_TIME )
         PunishPlayer( id );
      else if( flLastActivity >= ANNOUNCE_TIME ) {
         set_hudmessage( 0, 100, 255, -1.0, 0.4, 0, 0.0, 1.0, 0.1, 0.1 );
         ShowSyncHudMsg( id, g_iHudSync, "You have %i seconds to move", floatround( KICK_TIME - flLastActivity ) );
      }
   }
}

PunishPlayer( const id ) {
   new szName[ 32 ];
   get_user_name( id, szName, 31 );
   
   if( !WasAfkOnce( g_bWasAfkOnce, id ) ) {
      SetAfkOnce( id );
      
      user_kill( id );
      
      set_hudmessage( 0, 100, 255, -1.0, 0.4, 0, 0.0, 3.5, 0.1, 0.4 );
      ShowSyncHudMsg( id, g_iHudSync, "You have been killed for being away from keyboard" );
      
      ColorChat( 0, GREEN, "[ mY.RuN ]^4 %s^1 has been killed for being away from keyboard.", szName );
   } else {
      if( IsUserAdmin( id ) ) {
         user_kill( id );
         cs_set_user_team( id, CS_TEAM_SPECTATOR );
      } else {
         server_cmd( "kick #%i You has been kicked for being away from keyboard", get_user_userid( id ) );
         
         ColorChat( 0, GREEN, "[ mY.RuN ]^4 %s^1 has been kicked from the server for being away from keyboard.", szName );
      }
   }
}

eklenti-istekleri/colorchat-hatasi-vide ... -t142.html

Link:
Linklerini gizle
Linki Kopyala

Konu Sahibi
CssAttack
Mesajlar: 48
Kayıt: Prş Şub 16, 2017 9:50 am

Bu plugini düzenleyebilir misiniz?

Mesaj gönderen CssAttack »

PaZee yazdı:chatcolor inc sildim

colorchat enumu ekledim.

Kod: Tümünü seç

#include < amxmodx >
#include < cstrike >
#include < fakemeta >
#include < hamsandwich >

#define KICK_TIME     60
#define ANNOUNCE_TIME 45

#define SetAfkOnce(%1)   ( g_bWasAfkOnce |=    1 << ( %1 & 31 ) )
#define ClearAfkOnce(%1) ( g_bWasAfkOnce &= ~( 1 << ( %1 & 31 ) ) )
#define WasAfkOnce(%1)   ( g_bWasAfkOnce &     1 << ( %1 & 31 ) )

#define UpdateUserLastActivity(%1)   set_pdata_float( %1, 124, get_gametime( ), 5 )
// cs_set_user_lastactivity( %1, get_gametime( ) )
#define IsInTeam(%1)    ( CS_TEAM_T <= cs_get_user_team( %1 ) <= CS_TEAM_CT )
#define IsUserAdmin(%1) ( get_user_flags( %1 ) & ADMIN_KICK )




enum Color
{
    NORMAL = 1, // clients scr_concolor cvar color
    GREEN, // Green Color
    TEAM_COLOR, // Red, grey, blue
    GREY, // grey
    RED, // Red
    BLUE, // Blue
}

new TeamName[][] = 
{
    "",
    "TERRORIST",
    "CT",
    "SPECTATOR"
}

ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
    static message[256];

    switch(type)
    {
        case NORMAL: // clients scr_concolor cvar color
        {
            message[0] = 0x01;
        }
        case GREEN: // Green
        {
            message[0] = 0x04;
        }
        default: // White, Red, Blue
        {
            message[0] = 0x03;
        }
    }

    vformat(message[1], 251, msg, 4);

    // Make sure message is not longer than 192 character. Will crash the server.
    message[192] = '^0';

    static team, ColorChange, index, MSG_Type;
    
    if(id)
    {
        MSG_Type = MSG_ONE;
        index = id;
    } else {
        index = FindPlayer();
        MSG_Type = MSG_ALL;
    }
    
    team = get_user_team(index);
    ColorChange = ColorSelection(index, MSG_Type, type);

    ShowColorMessage(index, MSG_Type, message);
        
    if(ColorChange)
    {
        Team_Info(index, MSG_Type, TeamName[team]);
    }
}

ShowColorMessage(id, type, message[])
{
    message_begin(type, get_user_msgid("SayText"), _, id);
    write_byte(id)        
    write_string(message);
    message_end();    
}

Team_Info(id, type, team[])
{
    message_begin(type, get_user_msgid("TeamInfo"), _, id);
    write_byte(id);
    write_string(team);
    message_end();

    return 1;
}

ColorSelection(index, type, Color:Type)
{
    switch(Type)
    {
        case RED:
        {
            return Team_Info(index, type, TeamName[1]);
        }
        case BLUE:
        {
            return Team_Info(index, type, TeamName[2]);
        }
        case GREY:
        {
            return Team_Info(index, type, TeamName[0]);
        }
    }

    return 0;
}

FindPlayer()
{
    static i;
    i = -1;

    while(i <= get_maxplayers())
    {
        if(is_user_connected(++i))
        {
            return i;
        }
    }

    return -1;
} 

new Float:g_vAngles[ 33 ][ 3 ];
new g_iThinkingEnt, g_iHudSync, g_iIgnoreFirst, g_bWasAfkOnce;
new Trie:g_tAutoCmds;

public plugin_init( ) {
   register_plugin( "AFK", "1.0", "xPaw" );
   
   g_iHudSync = CreateHudSyncObj( );
   
   register_event( "HLTV", "EventNewRound", "a", "1=0", "2=0" );
   
   new szClassName[ 2 ];
   g_iThinkingEnt = get_maxplayers( ) + 1;
   
   while( pev_valid( g_iThinkingEnt ) && g_iThinkingEnt < 100 ) {
      pev( g_iThinkingEnt, pev_classname, szClassName, 1 );
      
      if( szClassName[ 0 ] == 0 )
         break;
      
      g_iThinkingEnt++;
   }
   
   RegisterHamFromEntity( Ham_Think, g_iThinkingEnt, "FwdThink", 1 );
   RegisterHam( Ham_Spawn, "player", "FwdHamPlayerSpawn", 1 );
   
   g_tAutoCmds = TrieCreate( );
   
   TrieSetCell( g_tAutoCmds, "vban", 1 );
   TrieSetCell( g_tAutoCmds, "specmode", 1 );
   TrieSetCell( g_tAutoCmds, "spec_set_ad", 1 );
   TrieSetCell( g_tAutoCmds, "VModEnable", 1 );
   TrieSetCell( g_tAutoCmds, "client_buy_close", 1 );
}

public plugin_end( )
   TrieDestroy( g_tAutoCmds );

public client_putinserver( id ) {
   UpdateUserLastActivity( id );
   ClearAfkOnce( id );
}

public client_command( id ) {
   new szCommand[ 13 ];
   read_argv( 0, szCommand, 12 );
   
   if( !TrieKeyExists( g_tAutoCmds, szCommand ) )
      UpdateUserLastActivity( id );
}

public EventNewRound( )
   g_iIgnoreFirst = 16; // ~5 seconds

public FwdHamPlayerSpawn( const id ) {
   if( is_user_alive( id ) ) {
      pev( id, pev_v_angle, g_vAngles[ id ] );
      
      UpdateUserLastActivity( id );
   }
}

public FwdThink( const iEntity ) {
   if( iEntity != g_iThinkingEnt || g_iIgnoreFirst-- > 0 )
      return;
   
   static Float:flGametime, Float:flLastCheck; flGametime = get_gametime( );
   
   if( flLastCheck > flGametime )
      return;
   
   flLastCheck = flGametime + 1.0;
   
   static iPlayers[ 32 ], iNum;
   get_players( iPlayers, iNum, "ach" );
   
//   if( iNum < 6 )
//      return;
   
   static i, id, Float:flLastActivity, Float:vAngles[ 3 ];
   
   for( i = 0; i < iNum; i++ ) {
      id = iPlayers[ i ];
      
      if( !IsInTeam( id ) )
         continue;
      
      pev( id, pev_v_angle, vAngles );
      
      if( vAngles[ 0 ] != g_vAngles[ id ][ 0 ] || vAngles[ 1 ] != g_vAngles[ id ][ 1 ] ) {
         UpdateUserLastActivity( id );
         g_vAngles[ id ][ 0 ] = vAngles[ 0 ];
         g_vAngles[ id ][ 1 ] = vAngles[ 1 ];
         
         continue;
      }
      
      flLastActivity = ( flGametime - cs_get_user_lastactivity( id ) );
      
      if( flLastActivity >= KICK_TIME )
         PunishPlayer( id );
      else if( flLastActivity >= ANNOUNCE_TIME ) {
         set_hudmessage( 0, 100, 255, -1.0, 0.4, 0, 0.0, 1.0, 0.1, 0.1 );
         ShowSyncHudMsg( id, g_iHudSync, "You have %i seconds to move", floatround( KICK_TIME - flLastActivity ) );
      }
   }
}

PunishPlayer( const id ) {
   new szName[ 32 ];
   get_user_name( id, szName, 31 );
   
   if( !WasAfkOnce( g_bWasAfkOnce, id ) ) {
      SetAfkOnce( id );
      
      user_kill( id );
      
      set_hudmessage( 0, 100, 255, -1.0, 0.4, 0, 0.0, 3.5, 0.1, 0.4 );
      ShowSyncHudMsg( id, g_iHudSync, "You have been killed for being away from keyboard" );
      
      ColorChat( 0, GREEN, "[ mY.RuN ]^4 %s^1 has been killed for being away from keyboard.", szName );
   } else {
      if( IsUserAdmin( id ) ) {
         user_kill( id );
         cs_set_user_team( id, CS_TEAM_SPECTATOR );
      } else {
         server_cmd( "kick #%i You has been kicked for being away from keyboard", get_user_userid( id ) );
         
         ColorChat( 0, GREEN, "[ mY.RuN ]^4 %s^1 has been kicked from the server for being away from keyboard.", szName );
      }
   }
}

eklenti-istekleri/colorchat-hatasi-vide ... -t142.html

Teşekkürler hocam adminlerime denettircem şimdi eğer çözüm sıkıntısız çalışırsa afk slay işini de halletmiş oluyoruz :)

Link:
Linklerini gizle
Linki Kopyala
Cevapla