Page 2 of 2

Re: cerere plugin

Posted: 13 Jan 2019, 17:34
by floringold01
merge acesta dar vreau acel mesaj ce apare sus event vip silver free sa apara in chat sau daca nu sa fie dezactivat

Multumesc anticipat

Re: cerere plugin

Posted: 13 Jan 2019, 18:21
by levin

Code: Select all

#include <amxmodx>

new const TAG[] = "[TAG]";

new bool:vip_free, g_msg_saytext;

public plugin_init()
{
	register_plugin("Free VIP Giver", "2.0", "cyby")
	check_time()
	set_task(60.0, "check_time", _, _, _, "b")
	
	g_msg_saytext = get_user_msgid("SayText");
}

public check_time()
{
	static preluare_ora[3], ora;
	get_time("%H", preluare_ora, 2)
	ora = str_to_num(preluare_ora)
	if(20 >= ora || ora < 8)
	{
		if(!vip_free)
			color(0, ".v%s.g Eventul.e Free VIP.g a fost activat!", TAG)
		vip_free = true
		server_cmd("amx_default_access ^"t^"")
	}
	else
	{
		if(vip_free)
			color(0, ".v%s.g Eventul.e Free VIP.g a fost dezactivat!", TAG)
		vip_free = false
		server_cmd("amx_default_access ^"z^"")
	}
	server_cmd("amx_reloadadmins")
}

stock 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")
	replace_all(msg, 190, ".g", "^1")
	replace_all(msg, 190, ".e", "^3")
	
	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, g_msg_saytext, _, players[i])
			write_byte(players[i]);
			write_string(msg);
			message_end();
		}
	}
}

Re: cerere plugin

Posted: 13 Jan 2019, 19:08
by floringold01
merge dar daca dai retry ...nu mai merge ...

Re: cerere plugin

Posted: 13 Jan 2019, 20:47
by levin
merge și cu retry

Re: cerere plugin

Posted: 14 Jan 2019, 08:38
by floringold01
mie nu imi merge daca te reconectez pe server...

Code: Select all

#include <amxmodx>

new const TAG[] = "[TAG]";

new bool:vip_free, g_msg_saytext;

public plugin_init()
{
   register_plugin("Free VIP Giver", "2.0", "cyby")
   check_time()
   set_task(60.0, "check_time", _, _, _, "b")
   
   g_msg_saytext = get_user_msgid("SayText");
}

public check_time()
{
   static preluare_ora[3], ora;
   get_time("%H", preluare_ora, 2)
   ora = str_to_num(preluare_ora)
   if(20 >= ora || ora < 13)
   {
      if(!vip_free)
         color(0, ".v%s.g Eventul.e Free VIP.g a fost activat!", TAG)
      vip_free = true
      server_cmd("amx_default_access ^"t^"")
   }
   else
   {
      if(vip_free)
         color(0, ".v%s.g Eventul.e Free VIP.g a fost dezactivat!", TAG)
      vip_free = false
      server_cmd("amx_default_access ^"z^"")
   }
   server_cmd("amx_reloadadmins")
}

stock 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")
   replace_all(msg, 190, ".g", "^1")
   replace_all(msg, 190, ".e", "^3")
   
   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, g_msg_saytext, _, players[i])
         write_byte(players[i]);
         write_string(msg);
         message_end();
      }
   }
}
MERGE PLUGINUL DAR NU MERGE ORA LA.M PUS INTRE ORA 20 13 EU LA ORA 17 AVEAM VIP SI NU APARE MESAJU VIPUL ESTE ACTIV SAU VIPU SA DEZACTIVAT

Re: cerere plugin

Posted: 16 Jan 2019, 17:34
by floringold01
up.

Re: cerere plugin

Posted: 16 Jan 2019, 19:18
by YONTU
cereri-pluginuri/pluginuri-des-cautate-amxmodx-t23259.html#p171940

Nr 6

Re: cerere plugin

Posted: 20 Jan 2019, 00:21
by floringold01
am tot incercat dar nu ...merge poate nu fac eu cv corect vreau free vip de la ora 20:00 pana la ora 13:00 vipu este pe flagu t va multumesc anticipat

Re: cerere plugin

Posted: 20 Jan 2019, 00:34
by levin
vezi să ai plg bun pentru admin.amxx
să ai ora setată corect pe server

Code: Select all

#include <amxmodx>

new const TAG[] = "[TAG]";

new bool:vip_free, g_msg_saytext;

public plugin_init()
{
   register_plugin("Free VIP Giver", "2.0", "cyby")
   check_time()
   set_task(60.0, "check_time", _, _, _, "b")
   set_task(1.0, "hud_mess", _, _, _, "b")
   
   g_msg_saytext = get_user_msgid("SayText");
}

public check_time()
{
   static preluare_ora[3], ora;
   get_time("%H", preluare_ora, 2)
   ora = str_to_num(preluare_ora)
   if(20 >= ora || ora <= 13)
   {
      if(!vip_free)
         color(0, ".v%s.g Este ora.e 20:00.g!!Toti jucatori aveti vip free!", TAG)
      vip_free = true
      server_cmd("amx_default_access ^"t^"")
   }
   else
   {
      if(vip_free)
         color(0, ".v%s.g Este ora.e 21:00.g!!Eventul free s-a sfarsit!", TAG)
      vip_free = false
      server_cmd("amx_default_access ^"z^"")
   }
   server_cmd("amx_reloadadmins")
}

public hud_mess()
{
   if(vip_free)
   {
      set_hudmessage(random(0), random(255), random(0), 0.00, 0.17, 1, 1.0, 1.0, 0.1, 0.1)
      show_hudmessage(0, "EVENT VIP 20:00 - 13:00")
   }
}

stock 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")
   replace_all(msg, 190, ".g", "^1")
   replace_all(msg, 190, ".e", "^3")

   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, g_msg_saytext, _, players[i])
            write_byte(players[i]);
            write_string(msg);
            message_end();
         }
      }
   }
}