1. Nëse akoma nuk jeni pjesë e forumit, ju ftojmë që të bëheni pjesë e këtij forumi duke u regjistruar.
    Dismiss Notice
  2. Ata qe kan harru password apo user ne te kontaktojn ne PM ju trregojm password.
    Dismiss Notice

[Tuturial] Admin Prefix

Tema tek 'CS - Tutorial's - Tip & Tricks' e hapur nga ProTeXx;, 25 Shkurt 2015.

View Users: View Users
  1. ProTeXx;

    ProTeXx; Kapiten

    Anëtarësuar:
    21 Shkurt 2015
    Postimet:
    183
    Pëlqime të marrura:
    0
    Prsh Djem Sot Do Tju Tregoj Si Me Editu Admin Prefix !Dmth Muni Me Bo [KRYESOR] [HEAD] [ADMIN] Etj Me Ndiqni Me Vemendje !

    Hapi 1. E Merni Codin .SMa ! Dhe Klikojm Ne Programin AMX Mod X Studio
    - Per Ato Qe Sekan Ne Pc Programin Amx Mod X1.8.1 Shkarko Poshte
    Shkarko AMX MOD X1.8.1

    Admin Prefix .SMA Copy e Bon
    Code:
    /* Plugin generated by AMXX-Studio */
    
    #include < amxmodx >
    
    
    #define PLUGIN "Rang Admin Chat Fixed"
    #define VERSION "1.0.0"
    
    #pragma semicolon 1
    
    #define	MAX_GROUPS	15
    
    
    // --| CC_ColorChat.
    enum Color
    {
    	NORMAL = 1, 		// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
    	GREEN, 			// Culoare Verde.
    	TEAM_COLOR, 		// Culoare Rosu, Albastru, Gri.
    	GREY, 			// Culoarea Gri.
    	RED, 			// Culoarea Rosu.
    	BLUE, 			// Culoarea Albastru.
    };
    
    new TeamName[  ][  ] = 
    {
    	"",
    	"TERRORIST",
    	"CT",
    	"SPECTATOR"
    };
    // --| CC_ColorChat.
    
    
    enum CsTeams 
    {
    	CS_TEAM_UNASSIGNED = 0,
    	CS_TEAM_T = 1,
    	CS_TEAM_CT = 2,
    	CS_TEAM_SPECTATOR = 3
    };
    
    new g_szGroups[ MAX_GROUPS ][ ] =
    {
    	"Detinator",
    	"Owner",
    	"Owner V.I.P.",
    	"Co-Owner",
    	"Co-Owner V.I.P.",
    	"GoD",
    	"GoD V.I.P.",
    	"Moderator",
    	"Moderator V.I.P.",
    	"Administrator",
                    "Administrator V.I.P.",
    	"Helper",
                    "Helper V.I.P.",
    	"Slot",
    	"Slot V.I.P."
    };
    
    new g_szGroupsFlags[ MAX_GROUPS ][ ] =
    {
    	"abcdefghijklmnopqrstu",
    	"abcdefijkosnwy",
    	"abcdefijkosntwy",
    	"abcdefijkoswy",
    	"abcdefijkostwy",
    	"bcdefijkswy",
    	"bcdefijkstwy",
    	"bcdefijkwy",
    	"bcdefijktwy",
    	"bcdefijky",
    	"bcdefijkty",
    	"bcdefij",
    	"bcdefijt",
    	"bi",
                    "bit"
    };
    
    new g_iGroupsFlagsValues[ MAX_GROUPS ];
    
    public plugin_init( )
    {
    	//Plugin original creat de Ex3cuTioN ( pluginuri-extream/rangadminchat-t81702.html )!
    	register_plugin( PLUGIN, VERSION, "Askhanar" );
    	
    	
    	register_clcmd("say","HookClCmdSay");
    	register_clcmd("say_team","HookClCmdSayTeam");
    	
    	for( new i = 0; i < MAX_GROUPS; i++ )
    		g_iGroupsFlagsValues[ i ] = read_flags( g_szGroupsFlags[ i ] );
    		
    	// Add your code here...
    }
    
    
    public HookClCmdSay( id )
    {
    	
    	if( is_user_bot( id ) )
    		return PLUGIN_CONTINUE;
    	
    	static szChat[ 192 ];
    	read_args( szChat, sizeof( szChat ) - 1 );
    	remove_quotes( szChat );
    	
    	if( equali( szChat,"" ) )
    		return PLUGIN_CONTINUE;
    	
    	static szName[ 32 ];
    	get_user_name( id, szName, sizeof ( szName ) -1 );
    		
    	if( is_user_admin( id ) )
    	{
    		static i; i = 0;
    		
    		for( i = 0; i < MAX_GROUPS; i++ )
    		{
    			
    			if( get_user_flags( id ) == g_iGroupsFlagsValues[ i ] )
    			{
    				
    				switch( get_user_team( id ) )
    				{
    					case CS_TEAM_T:		ColorChat( 0, RED,"^x04[%s]^x03%s^x01:%s", g_szGroups[ i ], szName, szChat );
    					case CS_TEAM_CT:	ColorChat( 0, BLUE,"^x04[%s]^x03%s^x01:%s", g_szGroups[ i ], szName, szChat );
    					case CS_TEAM_SPECTATOR:	ColorChat( 0, GREY,"^x04[%s]^x03%s^x01:%s", g_szGroups[ i ], szName, szChat );
    				}
    				
    				break;
    			}
    		}
    	}
    	
    	else
    	{
    		
    		switch( get_user_team( id ) )
    		{
    			case CS_TEAM_T:		ColorChat( 0, RED,"^x03%s%s^x01:%s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );
    			case CS_TEAM_CT:	ColorChat( 0, BLUE,"^x03%s%s^x01:%s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );
    			case CS_TEAM_SPECTATOR:	ColorChat( 0, GREY,"^x03%s^x01:%s", szName, szChat );
    		}
    		
    	}
    	
    	
    	return PLUGIN_HANDLED_MAIN;
    }
    
    public HookClCmdSayTeam( id )
    {
    	
    	if( is_user_bot( id ) )
    		return PLUGIN_CONTINUE;
    	
    	static szChat[ 192 ];
    	read_args( szChat, sizeof( szChat ) - 1 );
    	remove_quotes( szChat );
    	
    	if( equali( szChat,"" ) )
    		return PLUGIN_CONTINUE;
    	
    	static szName[ 32 ];
    	get_user_name( id, szName, sizeof ( szName ) -1 );
    	
    	static iPlayers[ 32 ];
    	static iPlayersNum;
    	
    	get_players( iPlayers, iPlayersNum, "ch" );
    	if( !iPlayersNum )
    		return PLUGIN_CONTINUE;
    	
    	static iPlayer, i;
    	if( is_user_admin( id ) )
    	{
    		static x; x = 0;
    		
    		for( x = 0; x < MAX_GROUPS; i++ )
    		{
    			
    			if( get_user_flags( id ) == g_iGroupsFlagsValues[ x ] )
    			{	
    	
    				for( i = 0; i < iPlayersNum; i++ )
    				{
    					
    					iPlayer = iPlayers[ i ];
    		
    					if( get_user_team( id ) == get_user_team( iPlayer ) )
    					{
    						switch( get_user_team( id ) )
    						{
    							case CS_TEAM_T:		ColorChat( iPlayer, RED, "^x04[%s]^x03(Terrorist) %s^x01:%s", g_szGroups[ x ], szName, szChat );
    							case CS_TEAM_CT:	ColorChat( iPlayer, BLUE, "^x04[%s]^x03(Counter-Terrorist) %s^x01:%s", g_szGroups[ x ], szName, szChat );
    							case CS_TEAM_SPECTATOR:	ColorChat( iPlayer, GREY, "^x04[%s]^x03(Spectator) %s^x01:%s", g_szGroups[ x ], szName, szChat );
    						}
    					}
    				}
    				
    				break;
    			}
    		}
    	}
    	
    	else
    	{
    		
    		for( i = 0; i < iPlayersNum; i++ )
    		{
    			
    			iPlayer = iPlayers[ i ];
    
    			if( get_user_team( id ) == get_user_team( iPlayer ) )
    			{
    				switch( get_user_team( id ) )
    				{
    					case CS_TEAM_T:		ColorChat( iPlayer, RED, "^x03(Terrorist)%s%s^x01:%s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );
    					case CS_TEAM_CT:	ColorChat( iPlayer, BLUE, "^x03(Counter-Terrorist)%s%s^x01:%s", is_user_alive( id ) ? "" : "*Mort* ", szName, szChat );
    					case CS_TEAM_SPECTATOR:	ColorChat( iPlayer, GREY, "^x03(Spectator) %s^x01:%s", szName, szChat );
    				}
    			}
    		}
    	}
    				
    	return PLUGIN_HANDLED_MAIN;
    }
    
    // From amxmisc.inc
    stock is_user_admin( id )
    {
    	new __flags=get_user_flags(id);
    	return (__flags>0 && !(__flags&ADMIN_USER));
    }
    // -----------------------
    
    
    // --| CC_ColorChat.
    ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
    {
    	
    	// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
    	if( !get_playersnum( ) ) return;
    	
    	new szMessage[ 256 ];
    
    	switch( iType )
    	{
    		 // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
    		case NORMAL:	szMessage[ 0 ] = 0x01;
    		
    		// Culoare Verde.
    		case GREEN:	szMessage[ 0 ] = 0x04;
    		
    		// Alb, Rosu, Albastru.
    		default: 	szMessage[ 0 ] = 0x03;
    	}
    
    	vformat(  szMessage[ 1 ], 251, msg, 4  );
    
    	// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
    	szMessage[ 192 ] = '^0';
    	
    
    	new iTeam, iColorChange, iPlayerIndex, MSG_Type;
    	
    	if( id )
    	{
    		MSG_Type  =  MSG_ONE_UNRELIABLE;
    		iPlayerIndex  =  id;
    	}
    	else
    	{
    		iPlayerIndex  =  CC_FindPlayer(  );
    		MSG_Type = MSG_ALL;
    	}
    	
    	iTeam  =  get_user_team( iPlayerIndex );
    	iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_Type, iType);
    
    	CC_ShowColorMessage(  iPlayerIndex, MSG_Type, szMessage  );
    		
    	if(  iColorChange  )	CC_Team_Info(  iPlayerIndex, MSG_Type,  TeamName[ iTeam ]  );
    
    }
    
    CC_ShowColorMessage(  id, const iType, const szMessage[  ]  )
    {
    	
    	static bool:bSayTextUsed;
    	static iMsgSayText;
    	
    	if(  !bSayTextUsed  )
    	{
    		iMsgSayText  =  get_user_msgid( "SayText" );
    		bSayTextUsed  =  true;
    	}
    	
    	message_begin( iType, iMsgSayText, _, id  );
    	write_byte(  id  );		
    	write_string(  szMessage  );
    	message_end(  );
    }
    
    CC_Team_Info( id, const iType, const szTeam[  ] )
    {
    	static bool:bTeamInfoUsed;
    	static iMsgTeamInfo;
    	if(  !bTeamInfoUsed  )
    	{
    		iMsgTeamInfo  =  get_user_msgid( "TeamInfo" );
    		bTeamInfoUsed  =  true;
    	}
    	
    	message_begin( iType, iMsgTeamInfo, _, id  );
    	write_byte(  id  );
    	write_string(  szTeam  );
    	message_end(  );
    
    	return 1;
    }
    
    CC_ColorSelection(  id, const iType, Color:iColorType)
    {
    	switch(  iColorType  )
    	{
    		
    		case RED:	return CC_Team_Info(  id, iType, TeamName[ 1 ]  );
    		case BLUE:	return CC_Team_Info(  id, iType, TeamName[ 2 ]  );
    		case GREY:	return CC_Team_Info(  id, iType, TeamName[ 0 ]  );
    
    	}
    
    	return 0;
    }
    
    CC_FindPlayer(  )
    {
    	new iMaxPlayers  =  get_maxplayers(  );
    	
    	for( new i = 1; i <= iMaxPlayers; i++ )
    		if(  is_user_connected( i )  )
    			return i;
    	
    	return -1;
    }
    // --| CC_ColorChat.
    /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
    *{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1033{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
    */
    
    Shkojm Ne AMX MOd Studio e Bejm Paste Shiko Foton ?
    [​IMG]

    Tash Si Te Editojm Te Bejm KRYESOR ADMIN ETJ
    [​IMG]

    I Bejm Kreiit Gati Tash Si Me Bo Compile Prej .SMA Ne Ammx

    E Bejm Save Filen
    [​IMG]

    Tash Ne Desktop e Keni Folderin Addons hym Ati Shkojm /amxmodx / scripting / Ketu e Keni 1 Program Qe Quhet amxxpc
    E Kapni Filen Qe e Keni Bo Gati Me EmriAdminPreFIX.Sma Dhe e Qojni Mbi Te amxxpc Shiko Foton Me Vemendje !
    [​IMG]

    Dhe Tani Automatikisht Do Tju Dale Amxx File Ne Desktop
    [​IMG]
     
  2. inL.

    inL. Legend

    Anëtarësuar:
    10 Korrik 2011
    Postimet:
    1,459
    Pëlqime të marrura:
    0
    Tutorial i mir nga ana jote, suksese.
     
  3. x0n1x.#

    x0n1x.# Hero

    Anëtarësuar:
    19 Korrik 2013
    Postimet:
    762
    Pëlqime të marrura:
    0
    gj , tutorial me vlere suksese
     
  4. joni.h

    joni.h Leitenant

    Anëtarësuar:
    2 Shkurt 2015
    Postimet:
    458
    Pëlqime të marrura:
    0
    Gj. Torturial Me Vlere Weq Wazhdo
     
  5. Prowow

    Prowow Major

    Anëtarësuar:
    2 Maj 2014
    Postimet:
    309
    Pëlqime të marrura:
    0
    amx.freakz.ro qe online compile me bo !
     
  6. ProTeXx;

    ProTeXx; Kapiten

    Anëtarësuar:
    21 Shkurt 2015
    Postimet:
    183
    Pëlqime të marrura:
    0
    Thenks
     
  7. ProTeXx;

    ProTeXx; Kapiten

    Anëtarësuar:
    21 Shkurt 2015
    Postimet:
    183
    Pëlqime të marrura:
    0
    Thenks
     
  8. ProTeXx;

    ProTeXx; Kapiten

    Anëtarësuar:
    21 Shkurt 2015
    Postimet:
    183
    Pëlqime të marrura:
    0
    Po Munesh Edhe Aty Por Menyra Me e Mir Dhe Me E Shpejt Esht Aty Si Eshte Ne Foto :)
     
  9. ProTeXx;

    ProTeXx; Kapiten

    Anëtarësuar:
    21 Shkurt 2015
    Postimet:
    183
    Pëlqime të marrura:
    0
    Thenks
     
  10. EPS Fenomen

    EPS Fenomen Leitenant

    Anëtarësuar:
    12 Janar 2015
    Postimet:
    404
    Pëlqime të marrura:
    2
    GJ Pun E Mir Braq
    Po Ma Let Pa Instalu E Editon Filen .sma Ne Amxmodx
     

Shpërndaje faqen

XenForo Add-ons & XenForo Styles ™ © 2012-2024 Brivium LLC.
  1. There are currently no users chatting.

You don't have the necessary permissions to use the chat.

There are currently no users chatting.
Chat [0]