User:RoadKillPuppy

From WolfWiki
Revision as of 08:58, 2 December 2005 by RoadKillPuppy (talk | contribs)
Jump to navigation Jump to search

Contact

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

Oh and btw: excuse me for my wiki-noobness...

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
-- thx r0f`deej for testing...  May your sprees be remembered!
--
-- 0.1 rkp
-- 0.2 rkp: dirty implementation of -1 parameter used by etadminmod
-- 0.3 rkp: workaround for etpro beta racecondition
-- 0.4 rkp: cleaned-up version for etpro 3.2.3

-- global varlist
PlaySoundVersion = "0.4"

-- called when game inits
function et_InitGame( levelTime, randomSeed, restart )
        et.RegisterModname( "rkp_playsound-" .. PlaySoundVersion .. " " .. et.FindSelf() )
        et.G_Print( "RoadKillPuppy's PlaySound version " ..  PlaySoundVersion .. " activated...\n" )
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

etadmin_sounds.pk3 pk3 with et_adminmod wav files (thx mark)

For a quick howto:

- ET Pro >= 3.2.3

- 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'