[EXTENSION] EngineSound
2 Attachment(s)
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:
|