HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

[Help!] Music + GetLocalPlayer + Me Sucking At JASS In General + Long Topic Name

10-03-2007, 12:38 AM#1
Tide-Arc Ephemera
I'm trying to use GetLocalPlayer to allow people to select their own music... and I'm failing at an alarming rate!

It gives me 4 errors:
Line 26: Expected end of line
Line 28: Expected a code statement
Line 30: Expected a code statement
Line 45: Expected a code statement

Collapse JASS:
function Trig_MC_Human_Actions takes nothing returns nothing
endfunction
  if GetLocalPlayer() == GetTriggerPlayer() then
    call PlayMusicBJ(gg_snd_MusicHuman)
  endif

//===========================================================================
function InitTrig_MC_Human takes nothing returns nothing
    set gg_trg_MC_Human = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_MC_Human, Player(0), "-music human", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_MC_Human, Player(1), "-music human", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_MC_Human, Player(2), "-music human", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_MC_Human, Player(3), "-music human", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_MC_Human, Player(4), "-music human", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_MC_Human, Player(5), "-music human", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_MC_Human, Player(6), "-music human", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_MC_Human, Player(7), "-music human", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_MC_Human, Player(8), "-music human", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_MC_Human, Player(9), "-music human", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_MC_Human, Player(10), "-music human", true )
    call TriggerRegisterPlayerChatEvent( gg_trg_MC_Human, Player(11), "-music human", true )
    call TriggerAddAction( gg_trg_MC_Human, function Trig_MC_Human_Actions )
endfunction


Amongst other things... can anybody tell me how to use this properly? I was only told how to do it in GUI, not purely in JASS. Even then I can't remember.
10-03-2007, 01:10 AM#2
Anopob
Erm, why are your lines of code outside of the function and endfunction words?
10-03-2007, 01:13 AM#3
Tide-Arc Ephemera
I am incredibly bad at JASS, and that's what a friend told me it should look like.
10-03-2007, 01:23 AM#4
TaintedReality
Put endfunction on the line below the endif. I'd recommend learning the basics of JASS if you're going to try to use it =P. Although if it's just for this one thing then whatever.
10-03-2007, 01:26 AM#5
Tide-Arc Ephemera
It are miracle! It works. Thanks for spending time on a REALLY simple problem...

+Rep

WOW! JUST WOW! I need to spread more rep before I can rep half the people I owe...
10-03-2007, 02:13 AM#6
Anopob
Hehe, very simple indeed. As TaintedReality suggested, if you want more JASS, look in the tutorials section.