1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 08:47:17 +01:00

Add a method to the player class that plays a sound which follows the player character.

This commit is contained in:
Sandu Liviu Catalin 2016-06-20 08:27:39 +03:00
parent e6213d0932
commit 933522f2a4
2 changed files with 15 additions and 0 deletions

View File

@ -1192,6 +1192,15 @@ void CPlayer::Redirect(CSStr ip, Uint32 port, CSStr nick, CSStr server_pass, CSS
}
}
// ------------------------------------------------------------------------------------------------
void CPlayer::PlaySound(Int32 sound_id) const
{
// Validate the managed identifier
Validate();
// Perform the requested operation
_Func->PlaySound(_Func->GetPlayerUniqueWorld(m_ID), sound_id, NAN, NAN, NAN);
}
// ------------------------------------------------------------------------------------------------
Int32 CPlayer::GetAuthority() const
{
@ -2287,6 +2296,7 @@ void Register_CPlayer(HSQUIRRELVM vm)
.Func(_SC("Spectating"), &CPlayer::GetSpectator)
.Func(_SC("Spectate"), &CPlayer::SetSpectator)
.Func(_SC("Redirect"), &CPlayer::Redirect)
.Func(_SC("PlaySound"), &CPlayer::PlaySound)
.Func(_SC("GetMsgPrefix"), &CPlayer::GetMessagePrefix)
.Func(_SC("SetMsgPrefix"), &CPlayer::SetMessagePrefix)
.Func(_SC("StreamByte"), &CPlayer::StreamByte)

View File

@ -705,6 +705,11 @@ public:
*/
void Redirect(CSStr ip, Uint32 port, CSStr nick, CSStr server_pass, CSStr user_pass);
/* --------------------------------------------------------------------------------------------
* Retrieve the authority level of the managed player entity.
*/
void PlaySound(Int32 sound_id) const;
/* --------------------------------------------------------------------------------------------
* Retrieve the authority level of the managed player entity.
*/