Raised This Month: $51 Target: $400
 12% 

[REQ] Block round start radio


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
anon12
Member
Join Date: Aug 2013
Old 11-01-2013 , 10:45   [REQ] Block round start radio
Reply With Quote #1

Hi can someone make me a plugin that blocks the radio at round start (Like "Go go go!")

I already tried this but it makes my server crash
PHP Code:
#include <amxmodx> 

#define VERSION "0.2.2" 
#define PLUGIN "RoundStart Radio Blocker" 

new Float:g_flRoundStartGameTime 
new gmsgSendAudiog_iMsgSendAudio 
new Trie:g_tStartRoundSounds 

public plugin_init() 

    
register_plugin(PLUGINVERSION"ConnorMcLeod"
    
register_logevent("LogEvent_Round_Start"2"1=Round_Start"

    
gmsgSendAudio get_user_msgid("SendAudio"

    new 
szStartRoundSounds[][] = { 
        
"%!MRAD_LOCKNLOAD"
        
"%!MRAD_MOVEOUT"
        
"%!MRAD_LETSGO"
        
"%!MRAD_GO"
        
"%!MRAD_ELIM"
        
"%!MRAD_GETOUT"
        
"%!MRAD_VIP" 
    


    
g_tStartRoundSounds TrieCreate() 
    for(new 
ii<sizeof(szStartRoundSounds); i++) 
    { 
        
TrieSetCell(g_tStartRoundSoundsszStartRoundSounds[i], 1
    } 


public 
LogEvent_Round_Start() 

    
g_flRoundStartGameTime get_gametime() 
    if( !
g_iMsgSendAudio 
    { 
        
g_iMsgSendAudio register_message(gmsgSendAudio"Message_SendAudio"
    } 


public 
Message_SendAudio()  

    if(
get_gametime() != g_flRoundStartGameTime
    { 
        
unregister_message(gmsgSendAudiog_iMsgSendAudio
        
g_iMsgSendAudio 
        
return PLUGIN_CONTINUE 
    


    new 
szArg2[18
    
get_msg_arg_string(2szArg2charsmax(szArg2)) 
    if( 
TrieKeyExists(g_tStartRoundSoundsszArg2) ) 
    { 
        if( 
get_msg_block(SVC_TEMPENTITY) == BLOCK_NOT 
        { 
            
set_msg_block(SVC_TEMPENTITYBLOCK_ONCE
        } 
        return 
PLUGIN_HANDLED 
    


    return 
PLUGIN_CONTINUE 

anon12 is offline
AvaStIn
Senior Member
Join Date: Feb 2013
Location: Algeria
Old 11-01-2013 , 17:23   Re: [REQ] Block round start radio
Reply With Quote #2

untested , i dont have a licence to make scripts hhhh
PHP Code:
#include <amxmodx>  

#define VERSION "0.2.2"  
#define PLUGIN "RoundStart Radio Blocker"  

new Float:g_flRoundStartGameTime  
new gmsgSendAudiog_iMsgSendAudio  
new Trie:g_tStartRoundSounds  
new gtoggle;

public 
plugin_init()  
{  
    
register_plugin(PLUGINVERSION"ConnorMcLeod")  
    
register_logevent("LogEvent_Round_Start"2"1=Round_Start")  
    
gtoggle register_cvar"amx_toggle""1" );

    
gmsgSendAudio get_user_msgid("SendAudio")  

    new 
szStartRoundSounds[][] = {  
        
"%!MRAD_LOCKNLOAD",  
        
"%!MRAD_MOVEOUT",  
        
"%!MRAD_LETSGO",  
        
"%!MRAD_GO",  
        
"%!MRAD_ELIM",  
        
"%!MRAD_GETOUT",  
        
"%!MRAD_VIP"  
    
}  

    
g_tStartRoundSounds TrieCreate()  
    for(new 
ii<sizeof(szStartRoundSounds); i++)  
    {  
        
TrieSetCell(g_tStartRoundSoundsszStartRoundSounds[i], 1)  
    }  
}  

public 
LogEvent_Round_Start()  
{  
    if( 
get_pcvar_numgtoggle ) != )
    {
            
g_flRoundStartGameTime get_gametime()  
           if( !
g_iMsgSendAudio )  
          {  
              
g_iMsgSendAudio register_message(gmsgSendAudio"Message_SendAudio")  
           }  
    }
}  

public 
Message_SendAudio()   
{  
    if(
get_gametime() != g_flRoundStartGameTime)  
    {  
        
unregister_message(gmsgSendAudiog_iMsgSendAudio)  
        
g_iMsgSendAudio 0  
        
return PLUGIN_CONTINUE  
    
}  

    new 
szArg2[18]  
    
get_msg_arg_string(2szArg2charsmax(szArg2))  
    if( 
TrieKeyExists(g_tStartRoundSoundsszArg2) )  
    {  
        if( 
get_msg_block(SVC_TEMPENTITY) == BLOCK_NOT )  
        {  
            
set_msg_block(SVC_TEMPENTITYBLOCK_ONCE)  
        }  
        return 
PLUGIN_HANDLED  
    
}  

    return 
PLUGIN_CONTINUE  

__________________
Project : Speedrun / Fastrun / CrazySpeed & [FPS CATEGORY]

o [
||||||||||||||||||||] - 95%

Project : Upgraded Drshop To V6.0

o [||||||||||||||||||||]- 100%
AvaStIn is offline
anon12
Member
Join Date: Aug 2013
Old 11-02-2013 , 01:09   Re: [REQ] Block round start radio
Reply With Quote #3

still crashes =/ it crash when i run it with this plugin https://forums.alliedmods.net/showthread.php?p=490083
anon12 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-02-2013 , 02:41   Re: [REQ] Block round start radio
Reply With Quote #4

I don't see why they would interfer.
Anyway, try to declare them in a different order in plugins.ini
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
anon12
Member
Join Date: Aug 2013
Old 11-02-2013 , 16:13   Re: [REQ] Block round start radio
Reply With Quote #5

tried it =( no luck. when i disable 1 of those plugin it works fine. crash happens everytime the round starts.

EDIT: not every round mostly like every 1-3 round

Last edited by anon12; 11-02-2013 at 16:21.
anon12 is offline
Old 11-02-2013, 16:55
pokemonmaster
This message has been deleted by pokemonmaster. Reason: Never mind, i didn't know why blocking SVC_TEMPENTITY
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-02-2013 , 17:07   Re: [REQ] Block round start radio
Reply With Quote #6

I have no clue, reading both codes, why it would crash server.

@pokemonmaster
SVC_TEMPENTITY is to remove the green '!' shown above player's head.


Try this :

PHP Code:
#include < amxmodx >

#pragma semicolon 1

#define PLUGIN "RoundStart Radio Blocker"
#define VERSION "0.3.0"

new gmsgSendAudiogmsgRoundTime;

new 
g_iSendAudio_BlockStatusg_iSVC_TEMPENTITY_BlockStatus;

new 
g_iMsgRoundTime;

public 
plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" );
    
register_logevent("LogEvent_Round_Start"2"1=Round_Start");

    
gmsgSendAudio get_user_msgid("SendAudio");
    
gmsgRoundTime get_user_msgid("RoundTime");
}

public 
LogEvent_Round_Start()
{
    new 
players[32], num;
    
get_players(playersnum"a");
    if( 
num )
    {
        if( !
g_iMsgRoundTime )
        {
            
g_iSendAudio_BlockStatus get_msg_block(gmsgSendAudio);
            
g_iSVC_TEMPENTITY_BlockStatus get_msg_block(SVC_TEMPENTITY);
            
set_msg_block(gmsgSendAudioBLOCK_SET);
            
set_msg_block(SVC_TEMPENTITYBLOCK_SET);
            
g_iMsgRoundTime register_message(gmsgRoundTime"Message_RoundTime");
        }
    }
}

public 
Message_RoundTime()
{
    
set_msg_block(gmsgSendAudiog_iSendAudio_BlockStatus);
    
set_msg_block(SVC_TEMPENTITYg_iSVC_TEMPENTITY_BlockStatus);
    
unregister_message(gmsgRoundTimeg_iMsgRoundTime);
    
g_iMsgRoundTime 0;

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 11-02-2013 at 17:23.
ConnorMcLeod is offline
Old 11-02-2013, 18:32
anon12
This message has been deleted by anon12. Reason: nvm it works thnx!
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 11-03-2013 , 05:51   Re: [REQ] Block round start radio
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
@pokemonmaster
SVC_TEMPENTITY is to remove the green '!' shown above player's head.
I figured that before deleting my post. anyway, thank you.
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
anon12
Member
Join Date: Aug 2013
Old 11-03-2013 , 15:01   Re: [REQ] Block round start radio
Reply With Quote #8

UPDATE: Plugin works but after a few map changes it stops working until i restart the server.
anon12 is offline
Debesėlis
Senior Member
Join Date: Aug 2008
Location: Lithuania
Old 11-10-2013 , 08:23   Re: [REQ] Block round start radio
Reply With Quote #9

Quote:
Originally Posted by anon12 View Post
UPDATE: Plugin works but after a few map changes it stops working until i restart the server.
same for me. Any fix?
Debesėlis is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 11-10-2013 , 08:45   Re: [REQ] Block round start radio
Reply With Quote #10

This sure work haha:
PHP Code:
#include <amxmodx>

new bool:bCanHear

public plugin_init()
{
    
register_plugin("Kush Kush Hota Hay""0.0.1""wbyokomo")
    
    
register_event("HLTV""OnNewRound""a""1=0""2=0")
    
register_logevent("OnRoundStart",2"1=Round_Start")
    
    
register_message(get_user_msgid("SendAudio"), "OnSendAudio")
}

public 
OnNewRound()
{
    
bCanHear false
}

public 
OnRoundStart()
{
    
remove_task(6153)
    
set_task(1.0"TaskEnableRadio"6153)
}

public 
OnSendAudio()
{
    if(!
bCanHear) return PLUGIN_HANDLED;
    
    return 
PLUGIN_CONTINUE;
}

public 
TaskEnableRadio()
{
    
bCanHear true

__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode