Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help PlaySoundOnPlayer
#1
PlaySoundOnPlayer(GetClient(0), "mp_bomb_plant");

Function plays a sound player client 0 ?

How to play the sound of all clients ?
Reply

#2
CSHARP Code
  1. List<ServerClient> clientlist = GetClients()
  2. foreach(ServerClient c in clientlist)
  3. {
  4. PlaySoundOnPlayer(c, "mp_bomb_plant");
  5. }
[Image: MaEIQ.png]
Reply

#3
read plugin documentation
http://cod6hmod.itshax.com/mw3_addon/doc...ndonplayer
Code:
PlaySoundOnPlayer(): Play a sound to the client.
ARGUMENTS
ServerClient Client:    Pplayer to play the sound on
String Sound:    Sound name

RETURNS
None

EXAMPLE
PlaySoundOnPlayer(GetClient(0), "mp_bomb_plant");

also, @Nukem , we can use Client.ClientNum there ??like
PlaySoundOnPlayer(Client.ClientNum, "mp_bomb_plant");
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#4
@jaydi ClientNum - int
Client - ServerClient

so... No.
[Image: azuw.jpg]
Reply

#5
Essentially, the function get's the client's ClientNum.... I guess Nukem just made it like that for simplicity's sake.

Code:
public unsafe void PlaySoundOnPlayer(ServerClient Client, string Sound)
{
    IntPtr hglobal = Marshal.StringToHGlobalAnsi(Sound);
    Server.CGSCFunc.PlaySoundToPlayer(GetSCClientByNum(Client.ClientNum), (sbyte modopt(IsSignUnspecifiedByte)*) hglobal.ToPointer());
    Marshal.FreeHGlobal(hglobal);
}
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
Reply

#6
Nice derail.

His question was "How to play the sound of all clients ?" and I answered.
[Image: MaEIQ.png]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Request] PlaySoundOnPlayer?? hillbilly 6 2,331 07-24-2012, 00:46
Last Post: hillbilly

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.