struct Score extends array
static multiboard MB
static multiboarditem MB_ITEM
static integer MB_COLUM_COUNT = 4 //Player Name | H Kills | C Kills | C Denies
static integer MB_ROW_COUNT = 1 //We will edit this value in method below, it's value will be equal to number of playing players + 1 for info
static string MB_TITLE = "Scoreboard" //Multiboard Name
static integer array PLAYER_ROW
static integer array PLAYER_ID
static boolean array B
static method editField takes integer row, integer col, string s returns nothing
set MB_ITEM = MultiboardGetItem(MB, row, col)
call MultiboardSetItemValue(MB_ITEM, s)
call MultiboardReleaseItem(MB_ITEM)
set MB_ITEM = null
endmethod
private static method runSetup takes nothing returns nothing
/* Basic Scripting DO NOT EDIT if you don't understand */
local integer i = 0
loop
exitwhen i>11
if GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING then
set PLAYER_ID[i] = GetPlayerId(Player(i))
set PLAYER_ROW[PLAYER_ID[i]] = MB_ROW_COUNT
set MB_ROW_COUNT = MB_ROW_COUNT + 1
set B[i] = true
endif
set i=i+1
endloop
set MB = CreateMultiboard()
call MultiboardSetRowCount(MB, MB_ROW_COUNT)
call MultiboardSetColumnCount(MB, MB_COLUM_COUNT)
call MultiboardSetTitleText(MB, MB_TITLE)
call MultiboardSetItemsStyle(MB, true, false)
/* End Basic Scripting DO NOT EDIT if you don't understand */
/* Column Dimenisions */
set i = 0
loop
exitwhen i>MB_ROW_COUNT
call MultiboardSetItemWidth(MultiboardGetItem(MB, i, 0), 0.07)
call MultiboardSetItemWidth(MultiboardGetItem(MB, i, 1), 0.05)
call MultiboardSetItemWidth(MultiboardGetItem(MB, i, 2), 0.05)
call MultiboardSetItemWidth(MultiboardGetItem(MB, i, 3), 0.05)
set i=i+1
endloop
/* End Column Dimenisions */
/* 1st Column Options */
call MultiboardSetItemStyle(MultiboardGetItem(MB, 0, 0), true, true)
call MultiboardSetItemIcon(MultiboardGetItem(MB, 0, 0), "ReplaceableTextures\\PassiveButtons\\PASBTNStatUp.blp")
call thistype.editField(0, 0, "|c00FEBA0EPlayer:")
/* End 1st Column Options */
/* 2nd Column Options */
call MultiboardSetItemStyle(MultiboardGetItem(MB, 0, 1), true, true)
call MultiboardSetItemIcon(MultiboardGetItem(MB, 0, 1), "ReplaceableTextures\\PassiveButtons\\PASBTNIncinerate.blp")
call thistype.editField(0, 1, "|c00FEBA0EH Kills:")
/* End 2nd Column Options */
/* 3rd Column Options */
call MultiboardSetItemStyle(MultiboardGetItem(MB, 0, 2), true, true)
call MultiboardSetItemIcon(MultiboardGetItem(MB, 0, 2), "ReplaceableTextures\\PassiveButtons\\PASBTNGnollCommandAura.blp")
call thistype.editField(0, 2, "|c00FEBA0EC Kills:")
/* End 3rd Column Options */
/* 4th Column Options */
call MultiboardSetItemStyle(MultiboardGetItem(MB, 0, 3), true, true)
call MultiboardSetItemIcon(MultiboardGetItem(MB, 0, 3), "ReplaceableTextures\\PassiveButtons\\PASBTNReincarnation.blp")
call thistype.editField(0, 3, "|c00FEBA0EC Denies:")
/* End 4th Column Options */
/* Field Starting Values */
set i = 0
loop
exitwhen i>11
if B[i] then
call thistype.editField(PLAYER_ROW[PLAYER_ID[i]], 0, GetPlayerName(Player(i)))
call thistype.editField(PLAYER_ROW[PLAYER_ID[i]], 1, I2S(0))
call thistype.editField(PLAYER_ROW[PLAYER_ID[i]], 2, I2S(0))
call thistype.editField(PLAYER_ROW[PLAYER_ID[i]], 3, I2S(0))
endif
set i=i+1
endloop
/* End Field Starting Values */
call MultiboardDisplay(MB, true)
endmethod
private static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEvent(t, 0., false)
call TriggerAddAction( t, function thistype.runSetup )
endmethod
endstruct