diff options
Diffstat (limited to 'npc/commands/music.txt')
-rw-r--r-- | npc/commands/music.txt | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/npc/commands/music.txt b/npc/commands/music.txt index e794060f..d2578d1a 100644 --- a/npc/commands/music.txt +++ b/npc/commands/music.txt @@ -21,9 +21,9 @@ OnCall: } // TODO: tmw-like argv splitter - getmapxy .@map$, .@void, .@void, UNITTYPE_PC; // get map + .@map$ = getmap(); - .@key$ = .@atcmd_parameters$[0]; + .@key$ = strtolower(.@atcmd_parameters$[0]); .@m$ = htget(.hash, .@key$, "Not found"); if (.@m$ == "Not found") @@ -34,8 +34,21 @@ OnCall: changemusic .@map$, .@m$ + ".ogg"; end; +OnMyself: + .@key$ = strtolower(.@atcmd_parameters$[0]); + .@m$ = htget(.hash, .@key$, "Not found"); + + if (.@m$ == "Not found") + { + .@m$ = implode(.@atcmd_parameters$[0], " "); + } + + changeplayermusic .@m$ + ".ogg"; + end; + OnInit: bindatcmd "music", "@music::OnCall", 0, 99, 1; + bindatcmd "jukebox", "@music::OnMyself", 0, 50, 0; .hash = htnew; // create hashtable htput(.hash, "forest", "bartk - in the forest of the birches"); |