Raised This Month: $ Target: $400
 0% 

sounds don't play from folder [Pirates, vikings, Knight 2]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ORdli
Member
Join Date: Nov 2021
Old 04-30-2023 , 18:22   Re: sounds don't play from folder [Pirates, vikings, Knight 2]
Reply With Quote #2

the plugin works but the sounds are not downloading...


#include <sourcemod>
#include <sdktools>

char g_sWSSounds[][] =
{
"*powderkegz1.mp3", "*powderkegz2.mp3", "*powderkegz3.mp3", "*powderkegz4.mp3"
};

int g_iLen = -1;

public Plugin myinfo =
{
name = "Keg Death Sound",
author = "ORdli",
version = "1.0",
};

public void OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath);
}

public void OnMapStart()
{
char sBuffer[256];
g_iLen = sizeof(g_sWSSounds);
for(int i = 0; i < g_iLen; i++)
{
Format(sBuffer, 256, "sound/explosion_rndsound/%s", g_sWSSounds[i][1]);

if(FileExists(sBuffer) || FileExists(sBuffer, true))
{
AddFileToDownloadsTable(sBuffer);
AddToStringTable(FindStringTable("soundprecac he"), g_sWSSounds[i]);
}
}
}


public Action Event_PlayerDeath(Event ev, const char[] name, bool dbc)
{
char sWeapon[64];
ev.GetString("weapon", sWeapon, 64);
if(strcmp(sWeapon, "powderkeg", true) == 0)
{
int random = GetRandomInt(0, g_iLen-1);
EmitSoundToAll(g_sWSSounds[random]);
}
}

Last edited by ORdli; 04-30-2023 at 18:25.
ORdli is offline
 


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 05:02.


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