[Modificare] Plugin gather

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
Miaw
Membru, skill 0
Membru, skill 0
Posts: 68
Joined: 27 Oct 2017, 00:05
Detinator Steam: Da
Fond eXtream: 0
Location: Romania
Contact:

25 Apr 2018, 17:11

salut,
am gasit un plugin de gather, merge apar mesajele porneste singur automat dar nu se opeste , scrie ca gatherul a inceput dar nu se opreste :-??, pun sursa mai jos, doresc sa fie modificat sa-i dau eu /start si /stop sa nu mai porneasca automat.
| Afiseaza codul
#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < dhudmessage >

#pragma tabsize 0

#define PLUGIN          "LLG Gather N"
#define VERSION         "1.2"
#define AUTHOR          "Team LLG & AZzeL"

#define	iNameRed	0
#define	iNameGreen	255
#define	iNameBlue	255

#define	iScoreRed	255
#define	iScoreGreen	0
#define	iScoreBlue	0

#define GAME_NAME         "LLG Gather"

new const gTagNameTE[ ] = "[LLG]";
new const gTagNameCT[ ] = "[LLG]";

new const gTag[ ]       = "LaLeagane.Ro";
new const gTagMesaj[ ]  = "Gather-ul a pornit";
new const gTagMesaj2[ ] = "Bafta la fraguri"; 

new bool:WarmUp;
new Seconds = 60;

new cvar_hud_msj, cvar_msj, cvar_msj_chat;

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

   cvar_hud_msj  = register_cvar("llg_hud_msj","1")
   cvar_msj      = register_cvar("llg_msj","1")
   cvar_msj_chat = register_cvar("llg_msj_chat","1")

   register_clcmd("say /llg","ShowMotd")

   register_forward( FM_GetGameDescription, "GameDesc" );

   register_event("TeamInfo", "Hook_TeamInfo", "a");
   register_event("CurWeapon", "Current_Weapon", "be", "1=1", "2!29");

   WarmUp = true;

   set_task(120.0, "RemoveWarmUp", 123);
   set_task(1.0, "ShowCountDown", 1234,_,_,"b",_);
      
}

public plugin_cfg()
{
   new cfgdir[32]
   get_configsdir(cfgdir, charsmax(cfgdir))
   server_cmd("exec %s/Gather/Gather.cfg", cfgdir)
}

public Hook_TeamInfo()
{
	new id = read_data(1);
		
	new szTeam[2];
	read_data(2, szTeam, charsmax(szTeam)); 
	
	new szName[32];
	get_user_name(id, szName, charsmax(szName));
	new szFormatName[50];

	switch( szTeam[0])
	{	
		case 'T':
		{
			if( equal(szName, gTagNameTE, charsmax(gTagNameTE)))
			{
				return;
			}
			
			if( !replace(szName, charsmax(szName), gTagNameCT, gTagNameTE))
			{
				formatex(szFormatName, charsmax(szFormatName), "%s %s", gTagNameTE, szName);
			}

			set_user_info(id, "name", szFormatName);
		}

		case 'C':
		{
			if( equal(szName, gTagNameCT, charsmax(gTagNameCT)))
			{
				return;
			}
			
			if( !replace( szName, charsmax(szName), gTagNameTE, gTagNameCT))
			{
				formatex(szFormatName, charsmax(szFormatName), "%s %s", gTagNameCT, szName);
			}
			
			set_user_info(id, "name", szFormatName);
		}
	}
	
    set_task(5.0, "welcome", id)
    return;
}

public welcome(id)
{
	new azlName[32]
	get_user_name(id, azlName, 31)

	set_hudmessage(iNameRed, iNameGreen, iNameBlue, -1.0, 0.10, 2, 0.05, 6.0, 0.01, 0.1, 2);
	show_hudmessage(id, "Salut %s^n Bun venit la Gather!^n Multumim pentru participare !", azlName)
}

public client_authorized(id)
{
        if(get_pcvar_num(cvar_msj_chat) == 1)
        {
              set_task(100.0, "PrintText" ,id)
        }
}

public PrintText(id)
{
     LLG_Color(id, ".g-=-=-= [ .vGather Nights .g] =-= [ .eLaLeagane.ro .g] =-=-=-")
     LLG_Color(id, ".g[.vGather-N.g] Pentru a vedea de ce aveti .v[LLG] .gla nume, scrieti in chat .e/llg.g.")
     LLG_Color(id, ".g-=-=-= [ .vGather Nights .g] =-= [ .eLaLeagane.ro .g] =-=-=-")
}

public Current_Weapon(id)
{
    if(WarmUp)
    {
        engclient_cmd(id, "weapon_knife");
    }
}

public ShowCountDown()
{
    set_hudmessage( iNameRed, iNameGreen, iNameBlue, -1.0, is_user_alive( 0 ) ? 0.03 : 0.03 , 0,_, 1.0, _, _ );
    show_hudmessage( 0, "<< [ Timp de incalzire ] >>^n<< [ %d ] >>", Seconds );

    Seconds--;

    if(Seconds <= 0)
    {
        if(task_exists(1234))
            remove_task(1234);
       
        WarmUp = false;

 	      set_task(1.0,"Restart");

        return;
    }
}

public Restart(id) 
{
	client_cmd(0,"spk ^"life in three seconds^"")

        server_cmd("sv_restart 3")

        if(get_pcvar_num(cvar_msj) != 0)
        {
            if( get_pcvar_num(cvar_msj) == 1 )
            {
	        LLG_Color(id, ".g[.v%s.g] |----------[.v%s !.g]--[.e%s !.g]--------|", gTag, gTagMesaj, gTagMesaj2 )
	        LLG_Color(id, ".g[.v%s.g] |----------[.v%s !.g]--[.e%s !.g]--------|", gTag, gTagMesaj, gTagMesaj2 )
	        LLG_Color(id, ".g[.v%s.g] |----------[.v%s !.g]--[.e%s !.g]--------|", gTag, gTagMesaj, gTagMesaj2 )
	        LLG_Color(id, ".g[.v%s.g] |----------[.v%s !.g]--[.e%s !.g]--------|", gTag, gTagMesaj, gTagMesaj2 )
            }

	    if( get_pcvar_num(cvar_msj) == 2 )
            {
               set_task(4.0, "MsjHUD")
            }
        }

        if(get_pcvar_num(cvar_hud_msj) == 1)
        {
              set_task(1.0, "MesajPermanent",0,"",0,"b")
        }
}

public MsjHUD()
{
    set_dhudmessage(iScoreRed, iScoreGreen, iScoreBlue, 0.04, 0.47, 0, 6.0, 7.0) 
    show_dhudmessage(0, "Gatherul a inceput^nDistractie placuta!" )
}

public MesajPermanent()
{
    set_dhudmessage( iScoreRed, iScoreGreen, iScoreBlue, -1.0, is_user_alive( 0 ) ? 0.06 : 0.00 , 0, _, 1.0, _, _ );
    show_dhudmessage( 0, "Gather-ul este pornit !" );
}

public RemoveWarmUp()

    WarmUp = false;

public GameDesc( ) { 
	forward_return( FMV_STRING, GAME_NAME ); 
	return FMRES_SUPERCEDE; 
}

public ShowMotd(id)
{
     show_motd(id, "addons/amxmodx/configs/Gather/llg.html")
}


stock LLG_Color( const id, const input[ ], any:... )
{
   new count = 1, players[ 32 ];

   static msg[ 191 ];
   vformat( msg, 190, input, 3 );

   replace_all( msg, 190, ".v", "^4" ); /* verde */
   replace_all( msg, 190, ".g", "^1" ); /* galben */
   replace_all( msg, 190, ".e", "^3" ); /* ct=albastru | t=rosu */
   replace_all( msg, 190, ".x", "^0" ); /* normal-echipa */
   
   if( id ) players[ 0 ] = id; 
   else get_players( players, count, "ch" );
   {
      for( new i = 0; i < count; i++ )
      {
         if( is_user_connected( players[ i ] ) )
         {
            message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] );
            write_byte( players[ i ] );
            write_string( msg );
            message_end( );
         }
      }
   }
}
RoyalServer 2
User avatar
faKe91
Fost moderator
Fost moderator
Posts: 1064
Joined: 07 Oct 2014, 18:49
Detinator Steam: Da
CS Status: I <3 Heavy Metal
SteamID: dogseatmypancreas
Reputatie: Fost moderator ajutator
Fost Membru Club eXtreamCS (doua luni)
Fond eXtream: 0
Location: Republica Moldova, Chișinău
Has thanked: 9 times
Been thanked: 12 times

27 Apr 2018, 20:57

Mutat in sectiunea corespunzatoare.
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 14 guests