Raised This Month: $32 Target: $400
 8% 

[CSGO] Round End Sounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author
katex
Junior Member
Join Date: Jun 2019
Plugin ID:
6632
Plugin Version:
0.3
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Plays sounds at the end of rounds
    Old 07-05-2019 , 14:13   [CSGO] Round End Sounds
    Reply With Quote #1

    Hello Everybody, It is my first plugin that doing something...
    I know the code is very messy but at least the plugin works
    However, Requirements:
    - 44,100 Hz
    - mp3 files
    - Sounds length has to be maximum 8sec


    You can put whatever you want, I put short pieces of music...
    Attached Files
    File Type: sp Get Plugin or Get Source (Round_End_Sounds.sp - 525 views - 5.4 KB)
    File Type: inc colors.inc (25.5 KB, 273 views)

    Last edited by katex; 07-05-2019 at 14:40.
    katex is offline
    TheBOSS
    Member
    Join Date: Nov 2018
    Old 07-05-2019 , 17:19   Re: [CSGO] Round End Sounds
    Reply With Quote #2

    https://forums.alliedmods.net/showthread.php?p=2338666
    TheBOSS is offline
    eliteroyal
    AlliedModders Donor
    Join Date: Dec 2016
    Location: Moldova
    Old 07-06-2019 , 04:11   Re: [CSGO] Round End Sounds
    Reply With Quote #3

    Quote:
    Originally Posted by TheBOSS View Post
    this plugin is for csgo only, thats the difference i guess
    __________________
    PEACE FROM MOLDOVA
    eliteroyal is offline
    Pan32
    Member
    Join Date: Dec 2010
    Location: ?
    Old 07-07-2019 , 11:07   Re: [CSGO] Round End Sounds
    Reply With Quote #4

    This... I mean, it works, but quite literally there is no real customization that does not require a recompile, not to mention plugin knowledge.

    Take a look at keyvalue config files, start using adt_arrays/adt_tries, and you'll have a much more tidy plugin.

    Also, line 82, you don't need such message, not only because if the plugin has issues, it will log on its own and show as failed state, but because you're not actually checking anything, so the message is misleading. The hook on line 87 should be on OnPluginStart, those hooks don't have to be reinitialized on every map change, plus, if you (re)load the plugin mid way through a map, the hook wont be there, and nothing will happen.

    Last edited by Pan32; 07-07-2019 at 17:29.
    Pan32 is offline
    szogun
    Senior Member
    Join Date: Apr 2016
    Old 07-08-2019 , 15:49   Re: [CSGO] Round End Sounds
    Reply With Quote #5

    plugin.sp(185) : error 088: cannot return a value from a void function

    plugin.sp(185) : warning 213: tag mismatch
    szogun is offline
    stephen473
    Senior Member
    Join Date: Jan 2017
    Location: somewhere on earth
    Old 07-10-2019 , 07:13   Re: [CSGO] Round End Sounds
    Reply With Quote #6

    Quote:
    Originally Posted by szogun View Post
    plugin.sp(185) : error 088: cannot return a value from a void function

    plugin.sp(185) : warning 213: tag mismatch
    you have to remove line 185, as error says
    __________________
    Also known as Hardy`.

    Feel free to contact me if you have a private plugin request!

    My Steam Profile | Discord: Hardy`#3792
    stephen473 is offline
    stephen473
    Senior Member
    Join Date: Jan 2017
    Location: somewhere on earth
    Old 07-10-2019 , 07:56   Re: [CSGO] Round End Sounds
    Reply With Quote #7

    also, i've edited your code. now it's better, and easier to configure

    PHP Code:
    #pragma semicolon 1

    #define DEBUG

    #include <sourcemod>
    #include <sdktools>
    #include <colors>


    // ----->> SONG LIST <<----- //
    static char g_sSongList[][][255] =  
    {  
        {
    "dnc_song1.mp3""Name Song 1"},  
        {
    "dnc_song2.mp3""Name Song 2"},  
        {
    "dnc_song3.mp3""Name Song 3"},  
        {
    "dnc_song4.mp3""Name Song 4"}
    };  
    // ----->> SONG LIST <<----- //


    #define g_sServerTag "{red}[Server]"

    public Plugin myinfo 
    {
        
    name "Round End Musics",
        
    author "KaTeX & stephen473",
        
    description "Puts Music at the end of Rounds..",
        
    version "1.1",
        
    url "https://steamcommunity.com/id/kHardy"
    };

    public 
    void OnPluginStart()
    {
        
    HookEvent("round_end"Event_RoundEndEventHookMode_Pre);
    }

    public 
    void OnMapStart()
    {
        
    int soundcount;
        
        for(
    int i 0<= sizeof(g_sSongList); i++) 
        {
            
    char buffer[PLATFORM_MAX_PATH];
            
    Format(buffersizeof(buffer), "sound/%s"g_sSongList[i][0]);
            
            
    AddFileToDownloadsTable(buffer);
            
    PrecacheSound(g_sSongList[i][0]);
            
    soundcount i;
        }
        
        
    PrintToServer("[Round End] %i sounds loaded."soundcount);
    }

    public 
    void Event_RoundEnd(Event event, const char[] namebool dontBroadcast)
    {
        
    int randomnum GetRandomInt(0sizeof(g_sSongList) - 1);
        
        
    EmitSoundToAll(g_sSongList[randomnum][0]);
        
    CPrintToChatAll("%s {default}Now is playing: {green}%s"g_sServerTagg_sSongList[randomnum][1]);

    __________________
    Also known as Hardy`.

    Feel free to contact me if you have a private plugin request!

    My Steam Profile | Discord: Hardy`#3792
    stephen473 is offline
    Reply


    Thread Tools
    Display Modes

    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 19:34.


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