User:RoadKillPuppy: Difference between revisions

From WolfWiki
Jump to navigation Jump to search
mNo edit summary
wiki-ed the script
Line 2: Line 2:
[http://bat5.serverdust.org bat5.serverdust.org] '''homepage of the BAT5 pub:fun clan'''
[http://bat5.serverdust.org bat5.serverdust.org] '''homepage of the BAT5 pub:fun clan'''
----
----
''etpro-lua'' - playsound <br>
 
[http://bat5.serverdust.org/etpro-lua/playsound/playsound.lua playsound.lua] '''playsound command addon via etpro-lua script'''<br>
== etpro-lua - ''playsound.lua'' ==
[http://bat5.serverdust.org/etpro-lua/playsound/admsounds.pk3 admsounds.pk3] '''pk3 with et_adminmod wav files'''<br>
The following script enables the ''playsound'' command when using etpro.  By feeding the server with the correct sound-files (pk3-based that is), it's possible for etadmin_mod to spam spree_sounds. 
<br>
 
For a quick howto:<br>
<pre><nowiki>
- ET Pro 3.2.2 beta test release 3 + serverside-mod support<br>
-- RoadKillPuppy's PlaySound / etpro lua module
- add -->set lua_modules "playsound.lua"<-- to server.cfg<br>
-- ex. 'rcon rconpass playsound -1 sound/etpro/hit.wav'
- copy the lua script and sound pk3 into your etpro dir<br>
--
- test with 'rcon rconpass playsound sound/etpro/hit.wav' and 'rcon rconpass playsound sound/misc/killingspree.wav'
-- copypasted 99% of the code from ReyalP's wolfwiki page
--
-- 0.1 rkp
-- 0.2 rkp: dirty implementation of -1 parameter used by etadminmod
 
-- global varlist
PlaySoundVersion = "0.2"
 
-- printf wrapper
function et.G_Printf(...)
        et.G_Print(string.format(unpack(arg)))
end
 
-- called when game inits
function et_InitGame( levelTime, randomSeed, restart )
--        et.G_Printf( "RoadKillPuppy's PlaySound version %s\n",PlayGSoundVersion )
        et.RegisterModname( "rkp_playsound-" .. PlaySoundVersion .. " " .. et.FindSelf() )
end
 
-- some help
function PlaySoundHelp()
        et.G_Print("usage: playsound -1 path_to_sound.wav\n");
end
 
-- react on new console command
function et_ConsoleCommand()
        if et.trap_Argv(0) == "playsound" then
                if et.trap_Argc() == 1 then
                        PlaySoundHelp()
                else
                        et.G_globalSound(et.trap_Argv(2));
                end
                return 1
        end
        return 0
end
</nowiki></pre>
 
[http://bat5.serverdust.org/etpro-lua/playsound/admsounds.pk3 admsounds.pk3] '''pk3 with et_adminmod wav files''' (untested)
 
For a quick howto:
 
- ET Pro 3.2.2 beta test release 3 + serverside-mod support
 
- add -->set lua_modules "playsound.lua"<-- to server.cfg
 
- copy the lua script and sound pk3 into your etpro dir
 
- test with 'rcon rconpass playsound -1 sound/etpro/hit.wav' and 'rcon rconpass playsound -1 sound/misc/killingspree.wav'


[[Category:ETPro:Mods]]
[[Category:ETPro:Mods]]

Revision as of 18:19, 5 November 2005

http://bani.anime.net/banimod/forums/images/avatars/2655845734090fc0ecc1e0.jpg

bat5.serverdust.org homepage of the BAT5 pub:fun clan


etpro-lua - playsound.lua

The following script enables the playsound command when using etpro. By feeding the server with the correct sound-files (pk3-based that is), it's possible for etadmin_mod to spam spree_sounds.

-- RoadKillPuppy's PlaySound / etpro lua module
-- ex. 'rcon rconpass playsound -1 sound/etpro/hit.wav'
--
-- copypasted 99% of the code from ReyalP's wolfwiki page
--
-- 0.1 rkp
-- 0.2 rkp: dirty implementation of -1 parameter used by etadminmod

-- global varlist
PlaySoundVersion = "0.2"

-- printf wrapper
function et.G_Printf(...)
        et.G_Print(string.format(unpack(arg)))
end

-- called when game inits
function et_InitGame( levelTime, randomSeed, restart )
--        et.G_Printf( "RoadKillPuppy's PlaySound version %s\n",PlayGSoundVersion )
        et.RegisterModname( "rkp_playsound-" .. PlaySoundVersion .. " " .. et.FindSelf() )
end

-- some help
function PlaySoundHelp()
        et.G_Print("usage: playsound -1 path_to_sound.wav\n");
end

-- react on new console command
function et_ConsoleCommand()
        if et.trap_Argv(0) == "playsound" then
                if et.trap_Argc() == 1 then
                        PlaySoundHelp()
                else
                        et.G_globalSound(et.trap_Argv(2));
                end
                return 1
        end
        return 0
end

admsounds.pk3 pk3 with et_adminmod wav files (untested)

For a quick howto:

- ET Pro 3.2.2 beta test release 3 + serverside-mod support

- add -->set lua_modules "playsound.lua"<-- to server.cfg

- copy the lua script and sound pk3 into your etpro dir

- test with 'rcon rconpass playsound -1 sound/etpro/hit.wav' and 'rcon rconpass playsound -1 sound/misc/killingspree.wav'