Few things first.
Self definition and examples >> http://gronnevik.se/rjukan/index.php...Language#toc25
Code:
The self object
There is a special object called "self".
The "self" object has its value set at the creation of a group of threads. The following are some such situations:
Automatically started scripts
self is NULL for level scripts. Self is the character for animation scripts.
Command: thread label
Since the new thread has the same group as the original thread, self in the new thread is equal to self in the original thread.
Command: object thread label
self in the new thread is set equal to object.
Event threads
If a thread is initiated in response to an event of an object, then self is set equal to this object.
Example:
Code:
If the thread move was called like
$player[1] thread move
self would be $player[1].
$player refers to an array of all players in the server, so in single player it would be just the one person, in multiplayer, it would be all players, $player[1] would be player 1.
local.player is NOT a predefined MOHAA variable. It is just a very common variable modders use to describe the player they are using. local. being the scope.
local.player MUST be defined in the specific scope to be used, most commonly it is defined like
local.player = parm.other // Mainly used by triggers as parm.other refers to the entity which triggered it.
local.player = self // Mainly used when scripts are called using that player entity, ie state_files, self is the player.
Now to your problem.
NB: Sounds have to be on client-side aswell to be heard.
Sounds are loaded into a aliascache (see ubersound/ubersound.scr) on mapload.
Each sound which is used for that particular map or gametype is loaded into the cache.
It is there that the settings for those sounds are then set. Settings such as sound file, pitch, min and max distance, loaded maps etc.
Example:
Code:
// UBER SOUND FILE
// Current Format:
// aliascache (?alias?) snd wavfile soundparms basevol volmod basepitch pitchmod minDist maxDist channel loaded|streamed maps "mapstr1 mapstring2 mapstring3 ..."
aliascache bombtick1 sound/items/Item_Timer_01.wav soundparms 0.7 0.0 1.0 0.0 10000 10000 local loaded maps "m1l2a m2 m3 m4l3 m5 m6l1 m6l3d dm moh obj train"
The alias for that sound file is bombtick1. Note how the min and max are set quite high, that is what makes all players be able to hear it. Distance is set from the object the sound is playing from.
An example of a way to *kinda* make it play for one person is
https://www.x-null.net/forums/showth...1313-Playsound
So instead of distributing a new ubersound.scr, you just need to create a new sound alias with your settings and use that.
Code:
local.master = spawn ScriptMaster
local.master aliascache beep sound/items/final_countdown.wav soundparms 0.1 0.0 1.0 0.0 100 100 voice loaded maps "m dm obj"
local.player playsound beep
If you read Veers comment on that thread, is that it can still sometimes get bugged. AFAIK that is the only way to make it play for one person. Maybe it is something we can add to the patch?, maybe.