User:RoadKillPuppy: Difference between revisions

From WolfWiki
Jump to navigation Jump to search
wiki-ed the script
No edit summary
Line 1: Line 1:
http://bani.anime.net/banimod/forums/images/avatars/2655845734090fc0ecc1e0.jpg<br><br>
http://bani.anime.net/banimod/forums/images/avatars/2655845734090fc0ecc1e0.jpg<br><br>
[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'''
Oh and btw: excuse me for my wiki-noobness...
----
----



Revision as of 18:55, 5 November 2005

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

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

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