Radio Flood management (solved)

Coding Help/Re-API Supported
Post Reply
User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 6 years ago
Location: Bucharest
Contact:

Radio Flood management (solved)

#1

Post by ArminC » 6 years ago

Where exactly in this whole plugin I can put the message like: You can use radio command in %s seconds? ++
Why // "%!MRAD_GO", (is commented)? + why there is a single whole function just for this command ? TrieSetCell(g_tRadioSounds, "%!MRAD_GO", 1)
- like I don't know why I commented and if it's because that function or.. idk..

PS: I tried on my country forum (here).. no chance at all for a reply (even if there are so many that know scripting (made more plugins for allied..), don't care or lazy :lol: )

Code: Select all

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define m_flNextRadio 191
#define m_iRadiosLeft 192

enum _:SendAudio_Datas
{
   SenderID = 1,
   AudioCode,
   Pitch
}

new Float:g_flRoundStart_GameTime
new Trie:g_tRadioSounds
new g_pCvarRadioDelay, g_pCvarRadioMax

public plugin_init()
{
   register_plugin("Radio Flood Management", "0.0.2", "ConnorMcLeod")

   g_pCvarRadioDelay = register_cvar("amx_radio_delay", "3.0") // (CS) Default: 1.5
   g_pCvarRadioMax = register_cvar("amx_radio_max", "60") // (CS) Default: 60

   RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1)

   register_logevent("LogEvent_Round_Start", 2, "1=Round_Start")
   register_event("SendAudio", "Event_SendAudio_Radio", "be", "2&%!MRAD_")

   new const szRadioSounds[][] = {
      "%!MRAD_COVERME",
      "%!MRAD_TAKEPOINT",
      "%!MRAD_POSITION",
      "%!MRAD_REGROUP",
      "%!MRAD_FOLLOWME",
      "%!MRAD_HITASSIST",

   //   "%!MRAD_GO",
      "%!MRAD_FALLBACK",
      "%!MRAD_STICKTOG",
      "%!MRAD_GETINPOS",
      "%!MRAD_STORMFRONT",
      "%!MRAD_REPORTIN",

      "%!MRAD_ROGER", "%!MRAD_AFFIRM",
      "%!MRAD_ENEMYSPOT",
      "%!MRAD_BACKUP",
      "%!MRAD_CLEAR",
      "%!MRAD_INPOS",
      "%!MRAD_REPRTINGIN",
      "%!MRAD_BLOW",
      "%!MRAD_NEGATIVE",
      "%!MRAD_ENEMYDOWN"
   }

   g_tRadioSounds = TrieCreate()
   for(new i; i<sizeof(szRadioSounds); i++)
   {
      TrieSetCell(g_tRadioSounds, szRadioSounds[i], 0)
   }
   TrieSetCell(g_tRadioSounds, "%!MRAD_GO", 1)
}

public LogEvent_Round_Start()
{
    g_flRoundStart_GameTime = get_gametime()
}

/*
Name:     SendAudio
Structure:    
byte    SenderID
string    AudioCode
short    Pitch
*/
public Event_SendAudio_Radio(id)
{
   new iSender = read_data(SenderID)
   if( iSender != id )
   {
      return
   }

   new szAudioCode[18], bGoGoGo
   read_data(AudioCode, szAudioCode, charsmax(szAudioCode))

   if( TrieGetCell(g_tRadioSounds, szAudioCode, bGoGoGo) )
   {
      if( bGoGoGo && get_gametime() == g_flRoundStart_GameTime )
      {
         return
      }
      set_pdata_float(id, m_flNextRadio, get_gametime() + get_pcvar_float(g_pCvarRadioDelay))
   }
}

public Player_Spawn_Post( id )
{
   if( is_user_alive(id) )
   {
      set_pdata_int(id, m_iRadiosLeft, get_pcvar_num(g_pCvarRadioMax))
   }
}

public plugin_end()
{
    TrieDestroy(g_tRadioSounds)
}
Last edited by ArminC 6 years ago, edited 1 time in total.

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#2

Post by Raheem » 6 years ago

ArminC wrote: 6 years ago Where exactly in this whole plugin I can put the message like: You can use radio command in %s seconds? ++
  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #include <hamsandwich>
  4.  
  5. #define m_flNextRadio 191
  6. #define m_iRadiosLeft 192
  7.  
  8. enum _:SendAudio_Datas
  9. {
  10.    SenderID = 1,
  11.    AudioCode,
  12.    Pitch
  13. }
  14.  
  15. new Float:g_flRoundStart_GameTime
  16. new Trie:g_tRadioSounds
  17. new g_pCvarRadioDelay, g_pCvarRadioMax
  18.  
  19. public plugin_init()
  20. {
  21.    register_plugin("Radio Flood Management", "0.0.2", "ConnorMcLeod")
  22.  
  23.    g_pCvarRadioDelay = register_cvar("amx_radio_delay", "3.0") // (CS) Default: 1.5
  24.    g_pCvarRadioMax = register_cvar("amx_radio_max", "60") // (CS) Default: 60
  25.    
  26.    RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1)
  27.  
  28.    register_logevent("LogEvent_Round_Start", 2, "1=Round_Start")
  29.    register_event("SendAudio", "Event_SendAudio_Radio", "be", "2&%!MRAD_")
  30.  
  31.    new const szRadioSounds[][] = {
  32.       "%!MRAD_COVERME",
  33.       "%!MRAD_TAKEPOINT",
  34.       "%!MRAD_POSITION",
  35.       "%!MRAD_REGROUP",
  36.       "%!MRAD_FOLLOWME",
  37.       "%!MRAD_HITASSIST",
  38.  
  39.    //   "%!MRAD_GO",
  40.       "%!MRAD_FALLBACK",
  41.       "%!MRAD_STICKTOG",
  42.       "%!MRAD_GETINPOS",
  43.       "%!MRAD_STORMFRONT",
  44.       "%!MRAD_REPORTIN",
  45.  
  46.       "%!MRAD_ROGER", "%!MRAD_AFFIRM",
  47.       "%!MRAD_ENEMYSPOT",
  48.       "%!MRAD_BACKUP",
  49.       "%!MRAD_CLEAR",
  50.       "%!MRAD_INPOS",
  51.       "%!MRAD_REPRTINGIN",
  52.       "%!MRAD_BLOW",
  53.       "%!MRAD_NEGATIVE",
  54.       "%!MRAD_ENEMYDOWN"
  55.    }
  56.  
  57.    g_tRadioSounds = TrieCreate()
  58.    for(new i; i<sizeof(szRadioSounds); i++)
  59.    {
  60.       TrieSetCell(g_tRadioSounds, szRadioSounds[i], 0)
  61.    }
  62.    TrieSetCell(g_tRadioSounds, "%!MRAD_GO", 1)
  63. }
  64.  
  65. public LogEvent_Round_Start()
  66. {
  67.     g_flRoundStart_GameTime = get_gametime()
  68. }
  69.  
  70. /*
  71. Name:     SendAudio
  72. Structure:    
  73. byte    SenderID
  74. string    AudioCode
  75. short    Pitch
  76. */
  77. public Event_SendAudio_Radio(id)
  78. {
  79.    new iSender = read_data(SenderID)
  80.    if( iSender != id )
  81.    {
  82.       return
  83.    }
  84.  
  85.    new szAudioCode[18], bGoGoGo
  86.    read_data(AudioCode, szAudioCode, charsmax(szAudioCode))
  87.  
  88.    if( TrieGetCell(g_tRadioSounds, szAudioCode, bGoGoGo) )
  89.    {
  90.       if( bGoGoGo && get_gametime() == g_flRoundStart_GameTime )
  91.       {
  92.          return
  93.       }
  94.       set_pdata_float(id, m_flNextRadio, get_gametime() + get_pcvar_float(g_pCvarRadioDelay))
  95.       client_print_color(id, print_team_default, "^3You can use radio again after %f Seconds^1!", get_pcvar_float(g_pCvarRadioDelay))
  96.    }
  97. }
  98.  
  99. public Player_Spawn_Post( id )
  100. {
  101.    if( is_user_alive(id) )
  102.    {
  103.       set_pdata_int(id, m_iRadiosLeft, get_pcvar_num(g_pCvarRadioMax))
  104.    }
  105. }
  106.  
  107. public plugin_end()
  108. {
  109.     TrieDestroy(g_tRadioSounds)
  110. }
ArminC wrote: 6 years ago Why // "%!MRAD_GO", (is commented)? + why there is a single whole function just for this command ?
TrieSetCell(g_tRadioSounds, "%!MRAD_GO", 1)
- like I don't know why I commented and if it's because that function or.. idk..
He commented it in the array because he need it to have another value in the Trie. if you see:
  • TrieSetCell(g_tRadioSounds, szRadioSounds[i], 0) All these cells set to 0
For GOGOGO:
  • TrieSetCell(g_tRadioSounds, "%!MRAD_GO", 1) The cell is set to 1
Why GO GO GO!? Simply if you think go to game and at start of every new round you will hear sound of GO GO GO!. So he in fact check if it's gogogo sound send by server to all players? or player used gogogo? If it's by server so we don't need to set a delay. If it's by player he set a delay. And in fact he know this by poor way not so good. He check if it's new round and if it's and there is gogogo so it's by server not player... But what if player at start of round used gogogo? it will think he is the server and won't add delay.. That is reason maybe why this plugin not approved here: https://forums.alliedmods.net/showthread.php?p=847690
ArminC wrote: 6 years ago PS: I tried on my country forum (here).. no chance at all for a reply (even if there are so many that know scripting (made more plugins for allied..), don't care or lazy :lol: )
No problem you are welcome but as i told you before we only SUPPORT ZE.. And i'll consider such request of help as general that can be useful in our Gameplay. Nevermind.
He who fails to plan is planning to fail

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 6 years ago
Location: Bucharest
Contact:

#3

Post by ArminC » 6 years ago

And in fact he know this by poor way not so good. He check if it's new round and if it's and there is gogogo so it's by server not player... But what if player at start of round used gogogo? it will think he is the server and won't add delay.. That is reason maybe why this plugin not approved here: https://forums.alliedmods.net/showthread.php?p=847690
So can you "optimize it" or what you recommend to do? use No Radio Flood? I saw that Conor made about 2 versions of plugins in No Radio Flood topic saying that's a better version of No Flood Radio after that he made this version (nr. 3) and I thought that's better than all (there are about 2-3 plugins and the Conor's one is the newest)..

(edit) I found this on xPaw ex-private git:

Code: Select all

#include < amxmodx >
#include < fakemeta >

#define RADIO_DELAY 5.0

#define m_flNextRadioGameTime 191

new g_iMsgSendAudio;
new g_iSendAudioEvent;
new Float:g_flRoundStartGameTime;

public plugin_init( )
{
	register_plugin( "No Radio Flood", "1.0", "xPaw" );
	
	register_event( "SendAudio", "EventSendAudio", "b", "2&%!MRAD_" );
	
	register_logevent( "EventRoundStart", 2, "1=Round_Start" );
	
	g_iMsgSendAudio = get_user_msgid( "SendAudio" );
}

public EventSendAudio( const id )
{
	if( id != read_data( 1 ) )
	{
		return;
	}
	
	new Float:flGameTime = get_gametime( );
	
	if( flGameTime != g_flRoundStartGameTime )
	{
		set_pdata_float( id, m_flNextRadioGameTime, flGameTime + RADIO_DELAY );
	}
}

public EventRoundStart( )
{
	g_flRoundStartGameTime = get_gametime( );
	
	if( !g_iSendAudioEvent )
	{
		g_iSendAudioEvent = register_message( g_iMsgSendAudio, "MessageSendAudio" );
	}
}

public MessageSendAudio( )
{
	if( g_flRoundStartGameTime != get_gametime( ) )
	{
		unregister_message( g_iMsgSendAudio, g_iSendAudioEvent );
		
		g_iSendAudioEvent = 0;
		
		return PLUGIN_CONTINUE;
	}
	
	return PLUGIN_HANDLED;
}
So what to do? 1) Optimize Conor's? or 2) Use No Radio Flood or 3)Use one of Conor's from No Radio Flood topic? or 3) Use xPaw ??

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#4

Post by Raheem » 6 years ago

This one you post by xPaw is same as Conner's one, But Conner's one if compared with xPaw it's better as it will try to handle GO GO GO better. So best one i advise to use: https://forums.alliedmods.net/showthread.php?p=847690 And this version is already optimized so not needed to use ReAPI in it at all.
He who fails to plan is planning to fail

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 6 years ago
Location: Bucharest
Contact:

#5

Post by ArminC » 6 years ago

(future edit) I didn't meant reapi optimize just optimize the function way to not use that gogogo as it is..

Ok so No Radio Flood but there is the plugin from the topic and other version eddited by users.. so wich one?

No Radio Flood (1.1) (I don't care about block Fire In The Hole function anyway)

Code: Select all

#include <amxmodx>

#define PLUGIN "No Radio Flood"
#define VERSION "1.1"
#define AUTHOR "Starsailor"

new Float:gRadio[33]
new pTime,pBlock

new szRadioCommands[][] =
{
	"radio1", "coverme", "takepoint", "holdpos", "regroup", "followme", "takingfire",
	"radio2", "go", "fallback", "sticktog", "getinpos", "stormfront", "report",
	"radio3", "roger", "enemyspot", "needbackup", "sectorclear", "inposition", "reportingin", "getout", "negative", "enemydown"
}


public plugin_init()
{	
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	for (new i=0; i<sizeof szRadioCommands; i++)
	{
		register_clcmd(szRadioCommands[i], "cmdRadio")
	}
	pTime = register_cvar("nrf_time","5")  //0 Disabled
	pBlock = register_cvar("nrf_block_fith","1")
	
	register_message(get_user_msgid("SendAudio"),"FireInTheHole")
	register_cvar("srf_version",VERSION,FCVAR_SERVER|FCVAR_SPONLY) //Srf = Stop Radio Flooding :D, Last Plugin name
	
}

public cmdRadio(id)
{
	
	new iTime = get_pcvar_num(pTime)
	
	if(!is_user_alive(id))
	{
		return PLUGIN_HANDLED_MAIN
	}
	
	if(iTime > 0)
	{  		
		new Float:fTime = get_gametime()
		
		if(fTime - gRadio[id] < iTime)
		{
			
			client_print(id,print_center,"Sorry, but you cannot abuse this command!")
			
			return PLUGIN_HANDLED_MAIN
		}
		
		gRadio[id] = fTime
	}
	
	return PLUGIN_CONTINUE
}

public FireInTheHole(msgid,msg_dest,msg_entity)
{
	
	if(get_msg_args() < 3 || get_msg_argtype(2) != ARG_STRING)
	{
		return PLUGIN_HANDLED
	}
	
	new szArg[32]
	
	get_msg_arg_string(2,szArg,31)
	
	if(equal(szArg ,"%!MRAD_FIREINHOLE") && get_pcvar_num(pBlock))
	{
		return PLUGIN_HANDLED;
	}
	
	return PLUGIN_CONTINUE;
}
No Radio Flood (edited first by hleV? (1.1) then by Connor (1.2)

Code: Select all

#include <amxmodx>
 
#define PLUGIN "Stop Radio Flood"
#define VERSION "1.2"
#define AUTHOR "Starsailor"
 
new g_szRadio[][] =
{
    "radio1", "coverme", "takepoint", "holdpos", "regroup", "followme", "takingfire",
    "radio2", "go", "fallback", "sticktog", "getinpos", "stormfront", "report",
    "radio3", "roger", "enemyspot", "needbackup", "sectorclear", "inposition", "reportingin", "getout", "negative", "enemydown"
}
 
new Float:g_fNextRadio[33]
new g_pTime
 
public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)

    for(new i = 0; i < sizeof(g_szRadio); i++)
    {
        register_clcmd(g_szRadio[i], "cmdRadio")
    }

    g_pTime = register_cvar("srf_time","5") 
}

public cmdRadio(id)
{
    new Float:fDelay = get_pcvar_float(g_pTime)
    if( fDelay )
    {
        new Float:fTime = get_gametime()

        if(g_fNextRadio[id] > fTime)
        {
            client_print(id,print_center,"** Stop flooding with radio **")
            return PLUGIN_HANDLED_MAIN
        }
        g_fNextRadio[id] = fTime + fDelay
    }
    return PLUGIN_CONTINUE
}
No Radio Flood -> Radio Flood Management (transition) (first version of that Radio Flood Management in this post but isn't like that, more likely No Radio Flood)

Code: Select all

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "0.0.1"

#define    m_flNextRadioTime    191
#define    m_iRadiosLeft        192

new g_pCvarMaxRadio, g_pCvarRadioDelay

public plugin_init()
{
    register_plugin("No Radio Flood", VERSION, "ConnorMcLeod")

    g_pCvarMaxRadio = register_cvar("amx_max_radios", "30")        // cs def 60
    g_pCvarRadioDelay = register_cvar("amx_radios_delay", "5")    // cs def ~ 1.5

    RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1)
    register_event("SendAudio", "Event_SendAudio", "be", "2&%!MRAD_GO")
}

public Player_Spawn_Post(id)
{
    if( is_user_alive(id) )
    {
        set_pdata_int(id, m_iRadiosLeft, get_pcvar_num(g_pCvarMaxRadio))
    }
}

public Event_SendAudio(id)
{
    if( read_data(1) == id )
    {
        set_pdata_float(id, m_flNextRadioTime, get_gametime() + get_pcvar_float(g_pCvarRadioDelay))
    }
}
Last edited by ArminC 6 years ago, edited 1 time in total.

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#6

Post by Raheem » 6 years ago

This is best one:

  1. #include <amxmodx>
  2.  
  3. #define PLUGIN "No Radio Flood"
  4. #define VERSION "1.1"
  5. #define AUTHOR "Starsailor"
  6.  
  7. new Float:gRadio[33]
  8. new pTime,pBlock
  9.  
  10. new szRadioCommands[][] =
  11. {
  12.     "radio1", "coverme", "takepoint", "holdpos", "regroup", "followme", "takingfire",
  13.     "radio2", "go", "fallback", "sticktog", "getinpos", "stormfront", "report",
  14.     "radio3", "roger", "enemyspot", "needbackup", "sectorclear", "inposition", "reportingin", "getout", "negative", "enemydown"
  15. }
  16.  
  17.  
  18. public plugin_init()
  19. {  
  20.     register_plugin(PLUGIN, VERSION, AUTHOR)
  21.    
  22.     for (new i=0; i<sizeof szRadioCommands; i++)
  23.     {
  24.         register_clcmd(szRadioCommands[i], "cmdRadio")
  25.     }
  26.     pTime = register_cvar("nrf_time","5")  //0 Disabled
  27.     pBlock = register_cvar("nrf_block_fith","1")
  28.    
  29.     register_message(get_user_msgid("SendAudio"),"FireInTheHole")
  30.     register_cvar("srf_version",VERSION,FCVAR_SERVER|FCVAR_SPONLY) //Srf = Stop Radio Flooding :D, Last Plugin name
  31.    
  32. }
  33.  
  34. public cmdRadio(id)
  35. {
  36.    
  37.     new iTime = get_pcvar_num(pTime)
  38.    
  39.     if(!is_user_alive(id))
  40.     {
  41.         return PLUGIN_HANDLED_MAIN
  42.     }
  43.    
  44.     if(iTime > 0)
  45.     {      
  46.         new Float:fTime = get_gametime()
  47.        
  48.         if(fTime - gRadio[id] < iTime)
  49.         {
  50.            
  51.             client_print(id,print_center,"Sorry, but you cannot abuse this command!")
  52.            
  53.             return PLUGIN_HANDLED_MAIN
  54.         }
  55.        
  56.         gRadio[id] = fTime
  57.     }
  58.    
  59.     return PLUGIN_CONTINUE
  60. }
  61.  
  62. public FireInTheHole(msgid,msg_dest,msg_entity)
  63. {
  64.    
  65.     if(get_msg_args() < 3 || get_msg_argtype(2) != ARG_STRING)
  66.     {
  67.         return PLUGIN_HANDLED
  68.     }
  69.    
  70.     new szArg[32]
  71.    
  72.     get_msg_arg_string(2,szArg,31)
  73.    
  74.     if(equal(szArg ,"%!MRAD_FIREINHOLE") && get_pcvar_num(pBlock))
  75.     {
  76.         return PLUGIN_HANDLED;
  77.     }
  78.    
  79.     return PLUGIN_CONTINUE;
  80. }
He who fails to plan is planning to fail

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 6 years ago
Location: Bucharest
Contact:

#7

Post by ArminC » 6 years ago

Ok, so that's the best from that 3.

How to set that %f seconds? (but not static 5 seconds, like taken from the seted cvar).. like if you press at seconds 5 to appear seconds 5 until you can use.. then after 2 seconds to appear you can use after 3 seconds..

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#8

Post by Raheem » 6 years ago

ArminC wrote: 6 years ago Ok, so that's the best from that 3.

How to set that %f seconds? (but not static 5 seconds, like taken from the seted cvar).. like if you press at seconds 5 to appear seconds 5 until you can use.. then after 2 seconds to appear you can use after 3 seconds..
Which plugin?
He who fails to plan is planning to fail

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 6 years ago
Location: Bucharest
Contact:

#9

Post by ArminC » 6 years ago

On that you said is the best from all above :)

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#10

Post by Raheem » 6 years ago

Here its:
  • Code: Select all

    #include <amxmodx>
     
    #define PLUGIN "No Radio Flood"
    #define VERSION "1.1"
    #define AUTHOR "Starsailor"
     
    new Float:gRadio[33]
    new pTime,pBlock
     
    new szRadioCommands[][] =
    {
    	"radio1", "coverme", "takepoint", "holdpos", "regroup", "followme", "takingfire",
    	"radio2", "go", "fallback", "sticktog", "getinpos", "stormfront", "report",
    	"radio3", "roger", "enemyspot", "needbackup", "sectorclear", "inposition", "reportingin", "getout", "negative", "enemydown"
    }
     
     
    public plugin_init()
    {  
    	register_plugin(PLUGIN, VERSION, AUTHOR)
    	
    	for (new i=0; i<sizeof szRadioCommands; i++)
    	{
    		register_clcmd(szRadioCommands[i], "cmdRadio")
    	}
    	pTime = register_cvar("nrf_time","5.5")  //0 Disabled
    	pBlock = register_cvar("nrf_block_fith","1")
    	
    	register_message(get_user_msgid("SendAudio"),"FireInTheHole")
    	register_cvar("srf_version",VERSION,FCVAR_SERVER|FCVAR_SPONLY) //Srf = Stop Radio Flooding :D, Last Plugin name
    }
     
    public cmdRadio(id)
    {
    	new Float:flTime = get_pcvar_float(pTime)
    	
    	if(!is_user_alive(id))
    	{
    		return PLUGIN_HANDLED_MAIN
    	}
    	
    	if(flTime > 0)
    	{      
    		new Float:fTime = get_gametime()
    
    		if(fTime - gRadio[id] < flTime)
    		{
    			if (flTime - (fTime - gRadio[id]) > 0.0)
    			{
    				client_print(id, print_center, "You can use radio again in %0.1f Seconds!", flTime - (fTime - gRadio[id]))
    			}
    			
    			return PLUGIN_HANDLED_MAIN
    		}
    
    		gRadio[id] = fTime
    	}
    	return PLUGIN_CONTINUE
    }
    
    public FireInTheHole(msgid,msg_dest,msg_entity)
    {
    	if(get_msg_args() < 3 || get_msg_argtype(2) != ARG_STRING)
    	{
    		return PLUGIN_HANDLED
    	}
    	
    	new szArg[32]
    
    	get_msg_arg_string(2,szArg,31)
    	
    	if(equal(szArg ,"%!MRAD_FIREINHOLE") && get_pcvar_num(pBlock))
    	{
    		return PLUGIN_HANDLED;
    	}
    	
    	return PLUGIN_CONTINUE;
    }
Screenshot:
  • Image
OH, Forget seconds in photo.. Not problem then i added to code.
He who fails to plan is planning to fail

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#11

Post by Spir0x » 6 years ago

never give up take.. finally it's same with Raheems one, but this one i have is from old mod v2.3 fix.

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 6 years ago
Location: Bucharest
Contact:

#12

Post by ArminC » 6 years ago

Thanks :) but why "%0.1f"? Anyway what's your server(s) (like from that video?)

(edit) isn't there a way to use colored hud messages?

@Spir0x Lol
Last edited by ArminC 6 years ago, edited 1 time in total.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 641
Joined: 7 years ago
Location: Tunisia
Contact:

#13

Post by Spir0x » 6 years ago

OK, i checked my plugin & raheems one have been updated by raheem use it.

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#14

Post by Raheem » 6 years ago

ArminC wrote: 6 years ago Thanks :) but why "%0.1f"? Anyway what's your server(s) (like from that video?)
%w.df Where w is the whole number width and d is the decimal numbers allowed. For example if you used this:
  • client_print(id, print_chat, "%4.2f", 1)
It will appear like 1.00 When you see the width of whole number it's: 1 then point then 0 then 0 they are 4 already and there is 2 for floating.
  • client_print(id, print_chat, "%3.1f", 1)
It will appear like 1.0 3 for whole number and just there is one for decimal.
  • client_print(id, print_chat, "%0.1f", 1)
This will print 1.0 But the number width is 0??? This mean it will be auto detected and padded right according to the number that will be displayed. And one for decimal.

Or you can use just %f this in case you don't need to specify how many decimals to appear. This up to you.

And so on, HOPE you get it.

You mean where i test these plugins or?
He who fails to plan is planning to fail

User avatar
ArminC
Senior Member
Senior Member
Romania
Posts: 137
Joined: 6 years ago
Location: Bucharest
Contact:

#15

Post by ArminC » 6 years ago

Aaa ok :)

"(edit) isn't there a way to use colored hud messages?" ?


You mean where i test these plugins or? --> I don't know.. I saw on your video a server.. or whatever, I didn't played escape for a long time :))

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#16

Post by Raheem » 6 years ago

Yes you can use HUD Text Message but center chat message is prefered than it in these conditions.

This server is mine i made to play on it when i get free time with my brother and neighbours.
He who fails to plan is planning to fail

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 6 guests