Activate plugin la o anumita zi si ora.

Cereri de pluginuri noi, skinuri in CS, etc.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
dsKed cristy
Membru, skill 0
Membru, skill 0
Posts: 83
Joined: 27 May 2010, 15:52
Detinator Steam: Da
CS Status: Stau degeaba
Detinator server CS: mix1/2/3/4.LLG.RO
SteamID: dsked1
Has thanked: 13 times
Contact:

05 Dec 2015, 02:56

Salut !
este vreo posibilitate sa se activeze AUTOMAT un plugin la o anumita data si ora?
Daca da, cum?Prin ce metoda?
MIX3.Laleagane.Ro

Live2day&die2morrow !

MIX4.Laleagane.Ro
RoyalServer 2
User avatar
Nubo
Fost moderator
Fost moderator
Posts: 2734
Joined: 11 Jul 2012, 18:45
Detinator Steam: Da
CS Status: [əˈnɒn.ɪ.məs]
Reputatie: Fost scripter eXtreamCS
Fost eXtream Mod
Has thanked: 8 times
Been thanked: 27 times

05 Dec 2015, 05:22

Tii pluginul mereu pe paused, cu Server Tasks sau Task Scheduler stabilesti ora (cu data nu cred ca este plugin gata facut) la care pluginul va fi scos din pauza.
Cand nu merge acest forum sunt online aici:
  • * Skype: nubo_cs
    * Y!M ID: nubo_cs
User avatar
DaNNe.
Fost moderator
Fost moderator
Posts: 2811
Joined: 08 Nov 2013, 20:43
Detinator Steam: Da
CS Status: Activitate scăzută
SteamID: /id/FurienMaster
Reputatie: Nick anterior: DnD. Gold, Emrys
0.5/3
Fost moderator ajutator
Fost Membru Club eXtreamCS (doua luni)
Has thanked: 244 times
Been thanked: 129 times
Contact:

06 Dec 2015, 21:25

Ai sursa de la plugin? Daca da, adauga direct in sursa sa functioneze la o anumita data intre anumite ore.
Folosesti urmatoarele pentru a detecta ziua si ora:
Pentru zi:

Code: Select all

date(An, Luna, Zi)
Pentru ora:

Code: Select all

time(Ore, Minute, Secunde)
iar in plugin folosesti:

Code: Select all

if(An == 2015 && Luna == 12 && Zi == 15 && Ora == 15) { 
cod...
...
}
User avatar
dsKed cristy
Membru, skill 0
Membru, skill 0
Posts: 83
Joined: 27 May 2010, 15:52
Detinator Steam: Da
CS Status: Stau degeaba
Detinator server CS: mix1/2/3/4.LLG.RO
SteamID: dsked1
Has thanked: 13 times
Contact:

09 Dec 2015, 02:48

Sma-ul:
| 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( );
         }
      }
   }
}

Cum trebuie sa arate codul cu if-ul tau?Plus ca banuiesc ca si codul trebuie scris in engleza.Gen year date hour... + ca nu trebuie sa tin cont si de ora si fusul orar la care este setat server-ul?Sunt destule variabile de luat in calcul...


Multumesc!
MIX3.Laleagane.Ro

Live2day&die2morrow !

MIX4.Laleagane.Ro
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest