Modificare plugin vip_free

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
SeReNo
Membru, skill 0
Membru, skill 0
Posts: 25
Joined: 18 Jan 2014, 18:53
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 1 time
Contact:

24 Jul 2014, 13:48

Salut, Am incercat sa fac un plugin in care la anumite ore sa primeasca toti de pe server vip free.
Problema e ca merge.. dar nu se opreste :))
| Afiseaza codul
#include <amxmodx>

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

new bool:vip_free, g_msg_saytext;

public plugin_init()
{
   register_plugin("Free VIP Giver", "2.0", "SeReNo")
   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(12 >= ora || ora <= 13)
   {
      if(!vip_free)
         color(0, ".v%s.g [Plugin by SeReNo] Este ora.e 12:00.g!!Toti jucatori aveti vip free! ", TAG)
      vip_free = true
      server_cmd("amx_default_access ^"bit^"")
   }
   else
   {
      if(vip_free)
         color(0, ".v%s.g [Plugin by SeReNo] Este ora.e 13:00.g!!Eventul free s-a sfarsit! ", TAG)
      vip_free = false
      server_cmd("amx_default_access ^"z^"")
   }
   server_cmd("amx_reloadadmins")
}
public hud_mes()
{
   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 V.I.P FREEE !")
   }

   static preluare_ora[3], ora;
   get_time("%H", preluare_ora, 2)
   ora = str_to_num(preluare_ora)
   if(20 >= ora || ora <= 23)
   {
      if(!vip_free)
         color(0, ".v%s.g [Plugin by SeReNo] Este ora.e 20:00.g!!Toti jucatori aveti vip free! ", TAG)
      vip_free = true
      server_cmd("amx_default_access ^"bit^"")
   }
   else
   {
      if(vip_free)
         color(0, ".v%s.g [Plugin by SeReNo] Este ora.e 23: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 V.I.P FREEE !")
   }
}

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))
         {
            message_begin(MSG_ONE_UNRELIABLE, g_msg_saytext, _, players)
            write_byte(players);
            write_string(msg);
            message_end();
         }
      }
   }
}

De ex la ora 13:00 ar trebui sa se opreasca.. si am asteptat inca 30 min, o ora.. si tot nu se opreste :))
Aveti vreo idee?
RoyalServer 2
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

24 Jul 2014, 13:57

prietene cum ai stiut sa modifici autorul asa ar trebui sa sti sa-l faci si singur sa functioneze corect.
daca te mai prind cu asa ceva ti le mut la cos in a 2-a secunda.
vezi asa.
| Afiseaza codul
#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(12 >= ora || ora < 13)
	{
		if(!vip_free)
			color(0, ".v%s.g Este ora.e 12:00.g!!Toti jucatori aveti vip free!", TAG)
		vip_free = true
		server_cmd("amx_default_access ^"abcefiju^"")
	}
	else
	{
		if(vip_free)
			color(0, ".v%s.g Este ora.e 13: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 V.I.P FREEE !")
	}
}

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))
			{
				message_begin(MSG_ONE_UNRELIABLE, g_msg_saytext, _, players)
				write_byte(players);
				write_string(msg);
				message_end();
			}
		}
	}
}
SeReNo
Membru, skill 0
Membru, skill 0
Posts: 25
Joined: 18 Jan 2014, 18:53
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 1 time
Contact:

24 Jul 2014, 14:15

K.. scuze. nu am stiut ca era facut de tine..
Dar eu voiam sa mearga la 2 intervale de timp daca se poate.
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

24 Jul 2014, 15:20

NU e facut de mine ci de cyby,nu ma bat sa il fac asa ca nu sunt sigur ca merge,mai bine il astepti chiar pe cyby,el poate sa te ajute cel mai bine.
Ake
Membru, skill +1
Membru, skill +1
Posts: 126
Joined: 19 Dec 2013, 17:30
Detinator Steam: Da
Has thanked: 88 times
Been thanked: 2 times

24 Jul 2014, 17:29

Asta nu merita ajutor, adica cei ca el nu merita ajutor :-j, daca ne-am pune toti la ' autor ' desi n-am fi, ar fi non cs
BoYkAaa
Membru, skill +1
Membru, skill +1
Posts: 197
Joined: 10 May 2015, 06:50
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

20 Sep 2015, 15:15

aceiasi problema o am si eu si in fine nu conteaza ca a sters el autoru si sa trecut pe sine asta e doar o dovada de nobizm etc ma puteti ajuta deci in modu urmator porneste pluginu nu se mai opreste de loc :)) dc ?
si tot nu am intelesc care e diferenta intre cele 2?
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests