Raised This Month: $61 Target: $400
 15% 

[CSS]RoundSound++


Post New Thread Reply   
 
Thread Tools Display Modes
ANTiCHRiST
Member
Join Date: Mar 2009
Location: Vienna, Austria
Old 05-06-2009 , 22:46   Re: [CSS]RoundSound++
Reply With Quote #11

i have long time not work on it i dont no why it dont run right.
__________________
ANTiCHRiST is offline
Send a message via ICQ to ANTiCHRiST Send a message via MSN to ANTiCHRiST
SigPwnU
Junior Member
Join Date: May 2009
Old 05-14-2009 , 09:22   Re: [CSS]RoundSound++
Reply With Quote #12

Hey in server console it says:



SV_StartSound: misc/twinnar.wav not precached (0)
SV_StartSound: misc/twinnar.wav not precached (0)
SV_StartSound: misc/twinnar.wav not precached (0)
SV_StartSound: misc/twinnar.wav not precached (0)
SV_StartSound: misc/twinnar.wav not precached (0)
SV_StartSound: misc/twinnar.wav not precached (0)

How i fix that?
And it doesnt play the sounds either, Or download =[

Last edited by SigPwnU; 05-16-2009 at 07:58.
SigPwnU is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 05-17-2009 , 03:15   Re: [CSS]RoundSound++
Reply With Quote #13

do all precache stuff in OnMapStart()
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
SigPwnU
Junior Member
Join Date: May 2009
Old 05-17-2009 , 08:19   Re: [CSS]RoundSound++
Reply With Quote #14

Quote:
Originally Posted by SAMURAI16 View Post
do all precache stuff in OnMapStart()
Err, Im kinda nooby in this stuff, how i "precache" the files?
SigPwnU is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 05-17-2009 , 10:52   Re: [CSS]RoundSound++
Reply With Quote #15

NAT already told you : http://forums.alliedmods.net/showpos...4&postcount=10
All related to precache stuff must be in OnMapStart()
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
SigPwnU
Junior Member
Join Date: May 2009
Old 05-18-2009 , 13:59   Re: [CSS]RoundSound++
Reply With Quote #16

Quote:
Originally Posted by SAMURAI16 View Post
NAT already told you : http://forums.alliedmods.net/showpos...4&postcount=10
All related to precache stuff must be in OnMapStart()

Somehow it works now thanks
__________________
O.o


SigPwnU is offline
shustas
SourceMod Donor
Join Date: May 2007
Location: London
Old 05-28-2009 , 10:47   Re: [CSS]RoundSound++
Reply With Quote #17

Why no team win is made to log an error? No team win is normal thing and not something extraordinary
__________________
shustas is offline
Blackfighter
New Member
Join Date: Jun 2009
Old 06-01-2009 , 19:18   Re: [CSS]RoundSound++
Reply With Quote #18

Plugin was not working, so I've tried something, updated code
Code:
/* *
 * ANTiCHRiST RoundSound++ 
 * -------------------------
 * Changelog
 *   changelog.txt
 * Readme
 *   readme.txt
 * Credits
 *   Old CS 1.6 Plugin
 *   by "PaintLancer"
 * -------------------------
 * by TanaToS aka ANTiCHRiST
 */
#include <sourcemod>
#include <sdktools>
#include <sdktools_sound>
#include <console>
#include <string>

#pragma semicolon 1

#define PLUGIN_VERSION "1.0.1"
#define MAX_FILE_LEN 256

new Handle:g_hEnabled = INVALID_HANDLE;
new bool:g_bEnabled = true;

public Plugin:myinfo = {
    name = "RoundSound++",
    author = "ANTiCHRiST",
    description = "Plays a Sound at RoundEnd.",
    version = PLUGIN_VERSION,
    url = "http://passionfighters.de"
};

public OnPluginStart() {
    CreateConVar("sm_roundsound_version", PLUGIN_VERSION, "RoundSound++ version.", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    g_hEnabled = CreateConVar("sm_roundsound_enable", "1", "RoundSound++ Enable/Disable CVar.", FCVAR_PLUGIN|FCVAR_NOTIFY);

    HookEvent("round_end", EventRoundEnd);
    HookConVarChange(g_hEnabled, CVarEnabled);
}

public OnMapStart()
{
    decl String:tewin_snd1[MAX_FILE_LEN];
    decl String:tewin_snd2[MAX_FILE_LEN];
    decl String:tewin_snd3[MAX_FILE_LEN];
    decl String:ctwin_snd1[MAX_FILE_LEN];
    decl String:ctwin_snd2[MAX_FILE_LEN];
    decl String:ctwin_snd3[MAX_FILE_LEN];

    Format(tewin_snd1, sizeof(tewin_snd1), "sound/misc/twinnar.wav");
    Format(tewin_snd2, sizeof(tewin_snd2), "sound/misc/twinnar2.wav");
    Format(tewin_snd3, sizeof(tewin_snd3), "sound/misc/twinnar3.wav");
    Format(ctwin_snd1, sizeof(ctwin_snd1), "sound/misc/ctwinnar2.wav");
    Format(ctwin_snd2, sizeof(ctwin_snd2), "sound/misc/ctwinnar3.wav");
    Format(ctwin_snd3, sizeof(ctwin_snd3), "sound/misc/ctwinnar4.wav");

    if(FileExists(tewin_snd1) && FileExists(tewin_snd2) && FileExists(tewin_snd3) && FileExists(ctwin_snd1) && FileExists(ctwin_snd2) && FileExists(ctwin_snd3)) {
        AddFileToDownloadsTable(tewin_snd1);
        AddFileToDownloadsTable(tewin_snd2);
        AddFileToDownloadsTable(tewin_snd3);
        AddFileToDownloadsTable(ctwin_snd1);
        AddFileToDownloadsTable(ctwin_snd2);
        AddFileToDownloadsTable(ctwin_snd3);

        PrecacheSound("misc/ctwinnar2.wav", true);
        PrecacheSound("misc/ctwinnar3.wav", true);
        PrecacheSound("misc/ctwinnar4.wav", true);
        PrecacheSound("misc/twinnar.wav", true);
        PrecacheSound("misc/twinnar2.wav", true);
        PrecacheSound("misc/twinnar3.wav", true);
    }
    else {
        LogError("Not all sound files exists.");
        LogError("Unload the Plugin.");
        ServerCommand("sm plugins unload \"RoundSound++.smx\"");
    }
}


public OnConfigsExecuted() {
    if(GetConVarBool(g_hEnabled)) {
        g_bEnabled = true;
    }
    else if(!GetConVarBool(g_hEnabled)) {
        g_bEnabled = false;
    }
    else {
        g_bEnabled = true;
        LogError("False value plugin continued");
    }
}

public CVarEnabled(Handle:convar, const String:oldValue[], const String:newValue[]) {
    if(GetConVarBool(g_hEnabled)) {
        g_bEnabled = true;
    }
    else if(!GetConVarBool(g_hEnabled)) {
        g_bEnabled = false;
    }
    else {
        g_bEnabled = true;
        LogError("False value plugin continued");
    }
}

public EventRoundEnd(Handle:event, const String:name[], bool:dontBroadcast) {
    LogError("RoundEnd");
    new rnd_sound = GetRandomInt(1, 3);
    new ev_winner = GetEventInt(event, "winner");
    if(g_bEnabled) {
        new MaxClients = GetMaxClients();

        for(new i=1; i<=MaxClients; i++)
        {
            if(IsClientInGame(i))
            {
        if(ev_winner == 2) {
            if(rnd_sound == 1) {
                EmitSoundToAll("misc/twinnar.wav",i, SNDCHAN_AUTO, SNDLEVEL_NORMAL, SND_NOFLAGS, SNDVOL_NORMAL, SNDPITCH_NORMAL);
            }
            else if(rnd_sound == 2) {
                EmitSoundToAll("misc/twinnar2.wav",i, SNDCHAN_AUTO, SNDLEVEL_NORMAL, SND_NOFLAGS, SNDVOL_NORMAL, SNDPITCH_NORMAL);
            }
            else if(rnd_sound == 3) {
                EmitSoundToAll("misc/twinnar3.wav",i, SNDCHAN_AUTO, SNDLEVEL_NORMAL, SND_NOFLAGS, SNDVOL_NORMAL, SNDPITCH_NORMAL);
            }
            else {
                LogError("Ramdom Sound CVar Error.");
            }
        }
        else if(ev_winner == 3) {
            if(rnd_sound == 1) {
                EmitSoundToAll("misc/ctwinnar2.wav",i, SNDCHAN_AUTO, SNDLEVEL_NORMAL, SND_NOFLAGS, SNDVOL_NORMAL, SNDPITCH_NORMAL);
            }
            else if(rnd_sound == 2) {
                EmitSoundToAll("misc/ctwinnar3.wav",i, SNDCHAN_AUTO, SNDLEVEL_NORMAL, SND_NOFLAGS, SNDVOL_NORMAL, SNDPITCH_NORMAL);
            }
            else if(rnd_sound == 3) {
                EmitSoundToAll("misc/ctwinnar4.wav",i, SNDCHAN_AUTO, SNDLEVEL_NORMAL, SND_NOFLAGS, SNDVOL_NORMAL, SNDPITCH_NORMAL);
            }
            else {
                LogError("Ramdom Sound CVar Error.");
            }
        }
        else {
            LogError("No team has win the round.");
        }
}
}
    }
}
Is there any way to disable default sound for Event.CTwin and Event.TERwin by server?
Thanks for plugin
Blackfighter is offline
ANTiCHRiST
Member
Join Date: Mar 2009
Location: Vienna, Austria
Old 06-06-2009 , 00:51   Re: [CSS]RoundSound++
Reply With Quote #19

u must only modify i
__________________
ANTiCHRiST is offline
Send a message via ICQ to ANTiCHRiST Send a message via MSN to ANTiCHRiST
saulstari
Member
Join Date: Jan 2006
Old 06-07-2009 , 15:10   Re: [CSS]RoundSound++
Reply With Quote #20

whats the song with the guitars?
saulstari 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 16:28.


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