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

Please help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lyric
Veteran Member
Join Date: Sep 2012
Old 06-26-2014 , 16:39   Please help
Reply With Quote #1

this plugin i got from a man so long ago that he doesnt play steam anymore and it stopped working and dont know why.

we had it so it would play a laugh sound when you die but now it just prints error to the console saying.. Failed to load sound "laugh.wav", file probably missing from disk/repository even though the file is there in the right directory on both server and client computer.. can someone please help as to why this isn't working?

Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

#define PLUGIN_NAME		""
#define PLUGIN_AUTHOR		""
#define PLUGIN_VERSION		"1.0"
#define PLUGIN_CONTACT		"http://forums.alliedmods.net"
#define PLUGIN_DESCRIPTION	""

#define DIE_LAUGH			"laugh.wav"
#define DIE_LAUGH_PATH	"sound/laugh/laugh.wav"

public Plugin:myinfo = {
	name			= PLUGIN_NAME,
	author			= PLUGIN_AUTHOR,
	description	= PLUGIN_DESCRIPTION,
	version		= PLUGIN_VERSION,
	url				= PLUGIN_CONTACT
};

public OnPluginStart()
{
	CreateConVar("laugh_version", PLUGIN_VERSION, "[TF2] laugh version", FCVAR_REPLICATED|FCVAR_NOTIFY | FCVAR_PLUGIN | FCVAR_SPONLY);
	//Translations file...
	LoadTranslations("common.phrases");
	/************************
	 * Event & Entity Hooks *
	 ************************/
	AddNormalSoundHook(SoundHook);
}
public Action:SoundHook(clients[64], &numClients, String:sample[PLATFORM_MAX_PATH], &entity, &channel, &Float:volume, &level, &pitch, &flags)
{
	if (StrContains(sample, "death", false) != -1)
	{
		strcopy(sample, sizeof(sample), DIE_LAUGH);
		return Plugin_Changed;
	}
	return Plugin_Continue;
}
public OnMapStart()
{
	if (FileExists(DIE_LAUGH_PATH))
	{
		PrecacheSound(DIE_LAUGH, true);
		AddFileToDownloadsTable(DIE_LAUGH_PATH);
	}
}
__________________
lyric is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-26-2014 , 16:53   Re: Please help
Reply With Quote #2

Shouldn't DIE_LAUGH be "laugh/laugh.wav" ?

Edit:
Basically, the only difference between DIE_LAUGH and DIE_LAUGH_PATH should be the sound/ at the start of DIE_LAUGH_PATH
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 06-26-2014 at 16:54.
Powerlord is offline
lyric
Veteran Member
Join Date: Sep 2012
Old 06-27-2014 , 19:20   Re: Please help
Reply With Quote #3

thank u vary much mr powerlord. it is fixed and going again!
__________________
lyric 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 20:11.


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