I try to create Multiboard , but I don't know how to show Multiboard for each player. Can show example for me plz.
if (GetLocalPlayer() == ...) then
My Condition is same Spartipilo's reply. but that It's work? And I wonder when I uses GetLocalPlayer() is dangerous. Example Dangerous to me. PLZ!!
function Create_MultiBoard takes nothing returns nothing
local multiboard array mb
local integer i = 0
loop
exitwhen i > 11
set mb[i] = CreateMultiboard()
call MultiboardSetRowCount(mb[i], 1)
call MultiboardSetColumnCount(mb[i], 1)
call MultiboardSetTitleText(mb[i], "MUULTIBOARD : "+GetPlayerName(Player(0)))
if(GetLocalPlayer() == ????)then // This I wonder Can I use any refer target player????
call MultiboardDisplay(mb[i], true)
endif
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Create_MultiBoard takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEventSingle( t, 0.00 )
call TriggerAddAction( t, function Create_MultiBoard )
set t = null
endfunction
call MultiboardDisplay(mb[i], Player(i) == GetLocalPlayer())
Inside the loop :
Jass:
call MultiboardDisplay(mb, Player(i) == GetLocalPlayer())
This way it will be false for all players excepted for Player(i), then the multiboard will be showed only for the Player(i).
why is the multiboard array local? you wont be able to access it once
scope multiboard initializer MultiBoard
globals
multiboard array mb
endglobals
private function Create_MultiBoard takes nothing returns nothing
local integer i=0
loop
exitwhen i>11
set mb[i]=CreateMultiboard()
call MultiboardSetRowCount(mb[i],1)
call MultiboardSetColumnCount(mb[i],1)
call MultiboardSetTitleText(mb[i],"MULTIBOARD : "+GetPlayerName(Player(0)))
if GetLocalPlayer()==GetTriggerPlayer()then
call MultiboardDisplay(mb[i],Player(i)==GetLocalPlayer())
endif
set i=i+1
endloop
endfunction
private function MultiBoard takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterTimerEvent(t,0.00,false)
call TriggerAddAction(t,function Create_MultiBoard)
set t = null
endfunction
endscope
if GetLocalPlayer()==GetTriggerPlayer()then
call MultiboardDisplay(mb[i],Player(i)==GetLocalPlayer())
endif
call MultiboardDisplay(mb[i],Player(i)==GetLocalPlayer())
scope multiboard initializer MultiBoard
globals
multiboard array mb
endglobals
private function Create_MultiBoard takes nothing returns nothing
local integer i=0
loop
exitwhen i>11
set mb[i]=CreateMultiboard()
call MultiboardSetRowCount(mb[i],1)
call MultiboardSetColumnCount(mb[i],1)
call MultiboardSetTitleText(mb[i],"MULTIBOARD : "+GetPlayerName(Player(0)))
call MultiboardDisplay(mb[i],Player(i)==GetLocalPlayer())
set i=i+1
endloop
endfunction
private function MultiBoard takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterTimerEvent(t,0.10,false)
call TriggerAddAction(t,function Create_MultiBoard)
set t = null
endfunction
endscope