HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

what is wrong with this?

01-02-2007, 01:39 AM#1
Joker
Collapse JASS:
function Trig_Red_Leaves_Actions takes nothing returns nothing
    local player a = Player(0)
    call SetPlayerAlliance( a, Player(2), ALLIANCE_SHARED_ADVANCED_CONTROL, true )
    call SetPlayerAlliance( a, Player(1), ALLIANCE_SHARED_ADVANCED_CONTROL, true )
    call SetPlayerAllianceBJ( a,ALLIANCE_SHARED_CONTROL, true, Player(2) )
    call SetPlayerAllianceBJ( a,ALLIANCE_SHARED_CONTROL, true, Player(1) )
    call DisplayTimedTextToPlayer( udg_AllPlayers, 0, 0, bj_TEXT_DELAY_ALWAYSHINT, GetPlayerName(a) + " has left the game.")
    call StartSound(bj_questHintSound)
    call ConditionalTriggerExecute( gg_trg_Remove_Human_Hero )
    call ConditionalTriggerExecute( gg_trg_Orc_Victory )
    call ConditionalTriggerExecute( gg_trg_Undead_Victory )
    call ConditionalTriggerExecute( gg_trg_Night_Elf_Victory )
/////////////////////
// MultiBoard Stuff//
/////////////////////
    call DestroyMultiboard( GetLastCreatedMultiboard() )
    call MultiboardDisplay( udg_Multiboard,true )
    call MultiboardSetRowCount( udg_Multiboard, udg_OneColum_TwoRow[2] - 1 )
    set a = null
    call DestroyTrigger( CreateTrigger() )
endfunction

//===========================================================================
function InitTrig_Red_Leaves takes nothing returns nothing
    set gg_trg_Red_Leaves = CreateTrigger(  )
    call TriggerRegisterPlayerEventLeave( gg_trg_Red_Leaves, Player(0) )
    call TriggerAddAction( gg_trg_Red_Leaves, function Trig_Red_Leaves_Actions )
endfunction
It highlights teh StartSound, but i dont think its the right one
01-02-2007, 02:36 AM#2
wyrmlord
Collapse JASS:
call DisplayTimedTextToPlayer( udg_AllPlayers, 0, 0, bj_TEXT_DELAY_ALWAYSHINT, GetPlayerName(a) + " has left the game.")
Is udg_AllPlayers a single player or a force? If it's a force, you should instead look into what this function does:
Collapse JASS:
function DisplayTimedTextToForce takes force toForce, real duration, string message returns nothing
    if (IsPlayerInForce(GetLocalPlayer(), toForce)) then
        // Use only local code (no net traffic) within this block to avoid desyncs.
        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, duration, message)
    endif
endfunction
01-02-2007, 02:56 AM#3
Joker
its a force, ill try that

Edit: Thanks it worked.