User:Phenomenon: Difference between revisions

From WolfWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
[[Category:ETPro:Mods]]
[[Category:ETPro:Mods]]
== ''Personal profile'' ==
== ''Personal profile'' ==


Line 14: Line 15:
:[irc://irc.quakenet.org:6667/force-opponents #force-opponents] - channel on QuakeNet
:[irc://irc.quakenet.org:6667/force-opponents #force-opponents] - channel on QuakeNet


== ''LUA script - <font color=red>playsoundcmd.lua</font>'' ==
<br>
 
===== Description =====
 
:This script adds new console commands ''<font color=gray>playsound</font>'' and ''<font color=gray>playsound_env</font>'' to your server. The difference to the already existing ''[[User:RoadKillPuppy|playsound.lua]]'' is this one can play a sound only for a certain player and/or also for players in the proximity of this player (exactly [http://et.tjw.org/etpub ETPub] behavior).


===== Requirements =====
== ''LUA script - <font color=blue>playsoundcmd.lua</font>'' ==
This script adds new console commands ''<font color=gray>playsound</font>'' and ''<font color=gray>playsound_env</font>'' to your server. The difference to the already existing ''[[User:RoadKillPuppy|playsound.lua]]'' is this one can play a sound only for a certain player and/or also for players in the proximity of this player (exactly [http://et.tjw.org/etpub ETPub] behavior).


===== '''''Requirements''''' =====
:*Wolfenstein - Enemy Territory (patched to v2.60b) - ''[http://www.splashdamage.com splashdamage.com]''
:*Wolfenstein - Enemy Territory (patched to v2.60b) - ''[http://www.splashdamage.com splashdamage.com]''
:*[[ETPro]] >= 3.2.6 installed - ''[http://etpro.anime.net etpro.anime.net]''
:*[[ETPro]] >= 3.2.6 installed - ''[http://etpro.anime.net etpro.anime.net]''


===== Installation =====
===== '''''Installation''''' =====
:*Download the LUA script ''[http://www.force-opponents.de/lua/playsoundcmd.lua playsoundcmd.lua]'' to your [[ETPro]] folder
:*Add the following command to your server configuration<pre>set lua_modules "playsoundcmd.lua"</pre>
:*Restart your server


:*Download the LUA script ''[http://www.force-opponents.de/lua/playsoundcmd.lua playsoundcmd.lua]'' to your etpro folder
===== '''''Usage''''' =====
:''<font color=gray>\rcon (rconpassword) playsound [sound]</font>'' plays '''sound''' for all clients<br>
:''<font color=gray>\rcon (rconpassword) playsound [name/slot#] [sound]</font>'' plays '''sound''' for '''name/slot#''' only<br>
:''<font color=gray>\rcon (rconpassword) playsound_env [name/slot#] [sound]</font>'' plays '''sound''' for '''name/slot#''' and surrounding clients only


:*Add the following command to your server.cfg
<br>


<pre>
== ''LUA function - <font color=blue>et.G_ClientSound()</font>'' ==
set lua_modules "playsoundcmd.lua"
Use this function in your own projects to play a sound for a certain client only.
</pre>


:*Restart your server
===== '''''Requirements''''' =====
:*[[ETPro]] >= 3.2.6 - ''[http://etpro.anime.net etpro.anime.net]''


===== Usage =====
===== '''''Usage''''' =====
:et.G_ClientSound('''clientnum''', '''soundfile''')
::Plays a global sound '''soundfile''' for a certain client '''clientnum''' only.


:''<font color=gray>playsound [sound]</font>'' will play sound for all clients<br>
===== '''''<font color=blue>CODE</font>''''' =====
<table><tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td><pre>
EV_GLOBAL_CLIENT_SOUND = 54


:''<font color=gray>playsound [name/slot#] [sound]</font>'' will play sound for that client only<br>
function et.G_ClientSound(clientnum, soundfile)
local tempentity = et.G_TempEntity(et.gentity_get(clientnum, "r.currentOrigin"), EV_GLOBAL_CLIENT_SOUND)
et.gentity_set(tempentity, "s.teamNum", clientnum)
et.gentity_set(tempentity, "s.eventParm", et.G_SoundIndex(soundfile))
end
</pre></td></tr></table>


:''<font color=gray>playsound_env [name/slot#] [sound]</font>'' will play sound for that client and surrounding players only<br>
__NOTOC__
__NOEDITSECTION__

Revision as of 09:52, 26 July 2006


Personal profile

Homepage
www.force-opponents.de - Home of the Force Opponents Clan
EMail
phenomenon@force-opponents.de
IRC
#force-opponents - channel on QuakeNet


LUA script - playsoundcmd.lua

This script adds new console commands playsound and playsound_env to your server. The difference to the already existing playsound.lua is this one can play a sound only for a certain player and/or also for players in the proximity of this player (exactly ETPub behavior).

Requirements
Installation
  • Download the LUA script playsoundcmd.lua to your ETPro folder
  • Add the following command to your server configuration
    set lua_modules "playsoundcmd.lua"
  • Restart your server
Usage
\rcon (rconpassword) playsound [sound] plays sound for all clients
\rcon (rconpassword) playsound [name/slot#] [sound] plays sound for name/slot# only
\rcon (rconpassword) playsound_env [name/slot#] [sound] plays sound for name/slot# and surrounding clients only


LUA function - et.G_ClientSound()

Use this function in your own projects to play a sound for a certain client only.

Requirements
Usage
et.G_ClientSound(clientnum, soundfile)
Plays a global sound soundfile for a certain client clientnum only.
CODE
     
EV_GLOBAL_CLIENT_SOUND = 54

function et.G_ClientSound(clientnum, soundfile)
	local tempentity = et.G_TempEntity(et.gentity_get(clientnum, "r.currentOrigin"), EV_GLOBAL_CLIENT_SOUND)
	et.gentity_set(tempentity, "s.teamNum", clientnum)
	et.gentity_set(tempentity, "s.eventParm", et.G_SoundIndex(soundfile))
end