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

[EXTENSION] EngineSound


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Knagg0
SourceMod Donor
Join Date: Dec 2005
Location: Germany
Old 06-12-2007 , 11:56   [EXTENSION] EngineSound
Reply With Quote #1

This extension allows you to call some functions of the enginesound interface

Install:
1. Extract 'enginesound.ext.dll' and 'enginesound.ext.so' to the 'addons/sourcemod/extensions' folder.
2. Extract 'enginesound.inc' to the 'addons/sourcemod/scripting/include' folder.

Natives:
Code:
/**
 * Prefetchs a given sound.
 *
 * @param sample		Name of the sound.
 * @noreturn
 */
native PrefetchSound(const String:sample[]);

/**
 * Gets the duration of a given sound.
 *
 * @param sample		Name of the sound.
 * @return			The duration.
 */
native Float:GetSoundDuration(const String:sample[]);

/**
 * Emit a given sound to one/all client(s).
 *
 * @param client		Index of the client to 'emit' the sound to (0 = all).
 * @param entity		Index of the entity to 'emit' the sound from.
 * @param channel		Channel of the sound.
 * @param sample		Name of the sound.
 * @param volume		Volume of the sound.
 * @param attenuation		Attenuation of the sound.
 * @param flags			Flags of the sound.
 * @param pitch			Pitch of the sound.
 * @param origin		Origin of the sound ({0.0,0.0,0.0} = ignore)
 * @param direction		Direction of the sound ({0.0,0.0,0.0} = ignore)
 * @param updateposition	Update the position of the sound (e.g. when the sound is attached to a player and he moves)
 * @param soundtime		How long the sound should play.
 * @param speakerentity
 * @noreturn
 */
native EmitSound(client, entity, channel, const String:sample[], Float:volume, Float:attenuation, flags=0, pitch=PITCH_NORM, Float:origin[3]={0.0,0.0,0.0}, Float:direction[3]={0.0,0.0,0.0}, bool:updateposition=true, Float:soundtime=0.0, speakerentity=-1);

/**
 * Emit a given sound to one/all client(s).
 * Same as EmitSound but it uses the soundlevel instead of attenuation.
 *
 * @param client		Index of the client to 'emit' the sound to (0 = all).
 * @param entity		Index of the entity to 'emit' the sound from.
 * @param channel		Channel of the sound.
 * @param sample		Name of the sound.
 * @param volume		Volume of the sound.
 * @param level			Soundlevel of the sound.
 * @param flags			Flags of the sound.
 * @param pitch			Pitch of the sound.
 * @param origin		Origin of the sound ({0.0,0.0,0.0} = ignore)
 * @param direction		Direction of the sound ({0.0,0.0,0.0} = ignore)
 * @param updateposition	Update the position of the sound (e.g. when the sound is attached to a player and he moves)
 * @param soundtime		How long the sound should play.
 * @param speakerentity
 * @noreturn
 */
native EmitSoundL(client, entity, channel, const String:sample[], Float:volume, soundlevel_t:level, flags=0, pitch=PITCH_NORM, Float:origin[3]={0.0,0.0,0.0}, Float:direction[3]={0.0,0.0,0.0}, bool:updateposition=true, Float:soundtime=0.0, speakerentity=-1);

/**
 * I don't know ^^
 * "Emit a sentence and also a close caption token for the sentence as appropriate."
 *
 * @param client		Index of the client to 'emit' the sound to (0 = all).
 * @param entity		Index of the entity to 'emit' the sound from.
 * @param channel		Channel of the sound.
 * @param sentence		Sentence of the sound.
 * @param volume		Volume of the sound.
 * @param level			Soundlevel of the sound.
 * @param flags			Flags of the sound.
 * @param pitch			Pitch of the sound.
 * @param origin		Origin of the sound ({0.0,0.0,0.0} = ignore)
 * @param direction		Direction of the sound ({0.0,0.0,0.0} = ignore)
 * @param updateposition	Update the position of the sound (e.g. when the sound is attached to a player and he moves)
 * @param soundtime		How long the sound should play.
 * @param speakerentity
 * @noreturn
 */
native EmitSentenceByIndex(client, entity, channel, sentence, Float:volume, soundlevel_t:level, flags=0, pitch=PITCH_NORM, Float:origin[3]={0.0,0.0,0.0}, Float:direction[3]={0.0,0.0,0.0}, bool:updateposition=true, Float:soundtime=0.0, speakerentity=-1);

/**
 * Stops an 'emited' sound of a given entity.
 *
 * @param entity		Index of the entity.
 * @param channel		Channel of the sound.
 * @param sample		Name of the sound.
 * @noreturn
 */
native StopSound(entity, channel, const String:sample[]);

/**
 * Emit an 'ambient' sound that isn't spatialized.
 *
 * @param sample		Name of the sound.
 * @param volume		Volume of the sound.
 * @param pitch			Pitch of the sound.
 * @param flags			Flags of the sound.
 * @param soundtime		How long the sound should play.
 * @noreturn
 */
native EmitAmbientSound(const String:sample[], Float:volume, pitch=PITCH_NORM, flags=0, Float:soundtime=0.0);
Changelog:
Quote:
1.0.0.0 (5/12/07)
  • First release
Attached Files
File Type: zip enginesound.zip (40.5 KB, 1215 views)
File Type: zip enginesound_src.zip (10.3 KB, 637 views)
__________________

MFZB Gaming Community

[ www.mfzb.de ]

Knagg0 is offline
 



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:12.


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