Add /rnd to round-info Plugin pls

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
Infamous2017
Membru, skill +1
Membru, skill +1
Posts: 228
Joined: 11 Feb 2017, 12:13
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 2 times
Contact:

15 Sep 2017, 22:00

Can anyone please add command /round and /rnd ?

That Players get the Message : the actually Round is 1 or 2.

Thx?
click | Afiseaza codul
#include <amxmodx>

#define R random(256)
#define G random(256)
#define B random(256)
#define time_hud 10.0

new round_count, msgsaytext
new cvar_show_msg, cvar_nextmap

public plugin_init()
{
	register_plugin("Round Info", "0.2", "P.Of.Pw")
	
	register_event("TextMsg", "game_comenc", "a", "2&#Game_C")

	register_logevent("roundstart", 2, "1=Round_Start")
	
	cvar_show_msg = register_cvar("round_msg", "1") // 1- msg chat color ; 2-msg hud
	cvar_nextmap = get_cvar_pointer("amx_nextmap")

	msgsaytext = get_user_msgid("SayText")
}

public game_comenc() 
{ 
	round_count = 0
}

public roundstart()
{
	new nextmap[32]
	get_pcvar_string(cvar_nextmap, nextmap, 31)

	new current_map[32]
	get_mapname(current_map, 31)

	new playersnum = get_playersnum()
	new maxplayers = get_maxplayers()
	
	if (get_pcvar_num(cvar_show_msg) == 1)
	{
		print_color(0, "^x01--[ ^x04Ronda: ^x03%d ^x01| ^x04Players: ^x03%d/%d | ^x04Map current: ^x03%s ^x01| ^x04Next Map: ^x03%s ^x01]--",
		round_count+=1, playersnum, maxplayers, current_map, nextmap)
	}

	else if (get_pcvar_num(cvar_show_msg) == 2)
	{
		set_hudmessage(R, G, B, -1.0, 0.4, 0, 6.0, time_hud)
		show_hudmessage(0, "--[ Ronda: %d | Players: %d/%d^n | Map current: %s | Next Map: %s ]--",
		round_count+=1, playersnum, maxplayers, current_map, nextmap)
	}
}

stock print_color(id, const message[], {Float,Sql,Result,_}:...)
{
	new Buffer[128],Buffer2[128],
	players[32], index, num, i

	formatex(Buffer2, sizeof Buffer2 - 1, "%s", message)
	vformat(Buffer, sizeof Buffer - 1, Buffer2, 3)
	get_players(players, num, "c")

	if (id) 
	{
		message_begin(MSG_ONE, msgsaytext, _, id)
		write_byte(id)
		write_string(Buffer)
		message_end()
	} 

	else 
	{
		for (i = 0; i < num;i++)
		{
			index = players
			if (!is_user_connected(index)) 
				continue

			message_begin(MSG_ONE,msgsaytext,_,index)
			write_byte(index)
			write_string( Buffer )
			message_end()
		}
	}
}
Last edited by NNX OWNAGE on 13 Oct 2017, 05:47, edited 1 time in total.
Reason: Ai codul /sursa
RoyalServer
User avatar
alexz24
Membru, skill 0
Membru, skill 0
Posts: 68
Joined: 06 Oct 2016, 16:43
Detinator Steam: Da
CS Status: a-mix.ro
Detinator server CS: DA
SteamID: ---
Fond eXtream: 0
Has thanked: 1 time
Contact:

13 Oct 2017, 04:47

It's not tested
click | Afiseaza codul
#include <amxmodx>

#define R random(256)
#define G random(256)
#define B random(256)
#define time_hud 10.0

new round_count, msgsaytext
new cvar_show_msg, cvar_nextmap

public plugin_init()
{
   register_plugin("Round Info", "0.2", "P.Of.Pw")
   
   register_event("TextMsg", "game_comenc", "a", "2&#Game_C")

   register_clcmd("say /round", "roundstart");
   register_clcmd("say /rnd", "roundstart");
   
   cvar_show_msg = register_cvar("round_msg", "1") // 1- msg chat color ; 2-msg hud
   cvar_nextmap = get_cvar_pointer("amx_nextmap")

   msgsaytext = get_user_msgid("SayText")
}

public game_comenc() 
{ 
   round_count = 0
}

public roundstart()
{
   new nextmap[32]
   get_pcvar_string(cvar_nextmap, nextmap, 31)

   new current_map[32]
   get_mapname(current_map, 31)

   new playersnum = get_playersnum()
   new maxplayers = get_maxplayers()
   
   if (get_pcvar_num(cvar_show_msg) == 1)
   {
      print_color(0, "^x01--[ ^x04Ronda: ^x03%d ^x01| ^x04Players: ^x03%d/%d | ^x04Map current: ^x03%s ^x01| ^x04Next Map: ^x03%s ^x01]--",
      round_count+=1, playersnum, maxplayers, current_map, nextmap)
   }

   else if (get_pcvar_num(cvar_show_msg) == 2)
   {
      set_hudmessage(R, G, B, -1.0, 0.4, 0, 6.0, time_hud)
      show_hudmessage(0, "--[ Ronda: %d | Players: %d/%d^n | Map current: %s | Next Map: %s ]--",
      round_count+=1, playersnum, maxplayers, current_map, nextmap)
   }
}

stock print_color(id, const message[], {Float,Sql,Result,_}:...)
{
   new Buffer[128],Buffer2[128],
   players[32], index, num, i

   formatex(Buffer2, sizeof Buffer2 - 1, "%s", message)
   vformat(Buffer, sizeof Buffer - 1, Buffer2, 3)
   get_players(players, num, "c")

   if (id) 
   {
      message_begin(MSG_ONE, msgsaytext, _, id)
      write_byte(id)
      write_string(Buffer)
      message_end()
   } 

   else 
   {
      for (i = 0; i < num;i++)
      {
         index = players
         if (!is_user_connected(index)) 
            continue

         message_begin(MSG_ONE,msgsaytext,_,index)
         write_byte(index)
         write_string( Buffer )
         message_end()
      }
   }
}
Last edited by NNX OWNAGE on 13 Oct 2017, 05:48, edited 1 time in total.
Reason: /sursa
My steam :hand_over_mouth:
*Or!g!naL*
Fost moderator
Fost moderator
Posts: 1367
Joined: 16 Feb 2014, 16:28
Detinator Steam: Nu
CS Status: N-avem!
Detinator server CS: Zm.Darkcs.ro
Reputatie: Fost moderator ajutator
Has thanked: 3 times
Been thanked: 1 time

14 Oct 2017, 19:17

| Afiseaza codul
#include <amxmodx>

#define R random(256)
#define G random(256)
#define B random(256)
#define time_hud 10.0

new round_count, msgsaytext
new cvar_show_msg, cvar_nextmap

public plugin_init()
{
   register_plugin("Round Info", "0.2", "P.Of.Pw")
   
   register_event("TextMsg", "game_comenc", "a", "2&#Game_C")

   register_clcmd("say /round", "prints");
   register_clcmd("say /rnd", "prints");
   
   cvar_show_msg = register_cvar("round_msg", "1") // 1- msg chat color ; 2-msg hud
   cvar_nextmap = get_cvar_pointer("amx_nextmap")

   msgsaytext = get_user_msgid("SayText")
}

public game_comenc() 
{ 
   round_count = 0
}

public roundstart()
{
   new nextmap[32]
   get_pcvar_string(cvar_nextmap, nextmap, 31)

   new current_map[32]
   get_mapname(current_map, 31)

   new playersnum = get_playersnum()
   new maxplayers = get_maxplayers()
   
   if (get_pcvar_num(cvar_show_msg) == 1)
   {
      print_color(0, "^x01--[ ^x04Ronda: ^x03%d ^x01| ^x04Players: ^x03%d/%d | ^x04Map current: ^x03%s ^x01| ^x04Next Map: ^x03%s ^x01]--",
      round_count+=1, playersnum, maxplayers, current_map, nextmap)
   }

   else if (get_pcvar_num(cvar_show_msg) == 2)
   {
      set_hudmessage(R, G, B, -1.0, 0.4, 0, 6.0, time_hud)
      show_hudmessage(0, "--[ Ronda: %d | Players: %d/%d^n | Map current: %s | Next Map: %s ]--",
      round_count+=1, playersnum, maxplayers, current_map, nextmap)
   }
}
public prints()
{ 
   if (get_pcvar_num(cvar_show_msg) == 1)
   {
      print_color(0, "^x01--[ ^x04The actually Ronda: ^x03%d ^x01| ]--",
      round_count+=1)
   }

   else if (get_pcvar_num(cvar_show_msg) == 2)
   {
      set_hudmessage(R, G, B, -1.0, 0.4, 0, 6.0, time_hud)
      show_hudmessage(0, "--[The actually Ronda: %d ]--",
      round_count+=1)
   }
}

stock print_color(id, const message[], {Float,Sql,Result,_}:...)
{
   new Buffer[128],Buffer2[128],
   players[32], index, num, i

   formatex(Buffer2, sizeof Buffer2 - 1, "%s", message)
   vformat(Buffer, sizeof Buffer - 1, Buffer2, 3)
   get_players(players, num, "c")

   if (id) 
   {
      message_begin(MSG_ONE, msgsaytext, _, id)
      write_byte(id)
      write_string(Buffer)
      message_end()
   } 

   else 
   {
      for (i = 0; i < num;i++)
      {
         index = players
         if (!is_user_connected(index)) 
            continue

         message_begin(MSG_ONE,msgsaytext,_,index)
         write_byte(index)
         write_string( Buffer )
         message_end()
      }
   }
}
Image
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests