Official Battle Tanks Community
I want this - Printable Version

+- Official Battle Tanks Community (https://btanks.net/forum)
+-- Forum: Battle Tanks - Warcraft III (https://btanks.net/forum/forumdisplay.php?fid=3)
+--- Forum: Suggestions (https://btanks.net/forum/forumdisplay.php?fid=8)
+--- Thread: I want this (/showthread.php?tid=4649)



I want this - RaptorXI - 2015-05-27

Quote:
Change Color Wrote:function Cond_Change_Color takes nothing returns boolean

    return SubString(GetEventPlayerChatString(),0,1) == "-"
endfunction

function SetPlayerColorDK takes player changer, playercolor color returns nothing
    local group g
    local integer pid = GetPlayerId(changer)
    local multiboarditem mbitem

    call SetPlayerColor(changer, color)
    set udg_Colors[pid+1] = GetPlayerTextColor(changer)
    if pid < 3 then
        set mbitem = MultiboardGetItem(udg_LeftBoard,pid+1,0)
    else
        set mbitem = MultiboardGetItem(udg_RightBoard,pid-2,0)
    endif
    call MultiboardSetItemValue(mbitem,GetPlayerNameColored(changer))
    call MultiboardReleaseItem(mbitem)
    set mbitem = MultiboardGetItem(udg_OtherBoard,pid+1,0)
    call MultiboardSetItemValue(mbitem,GetPlayerNameColored(changer))
    call MultiboardReleaseItem(mbitem)
    set bj_setPlayerTargetColor = color
    set g = CreateGroup()
    call GroupEnumUnitsOfPlayer(g, changer, Condition(function AlwaysTrue))
    call ForGroup(g, function SetPlayerColorBJEnum)
    call DestroyGroup(g)
endfunction

function Trig_Change_Color_Actions takes nothing returns nothing
    local string color = SubString(GetEventPlayerChatString(),7,StringLength(GetEventPlayerChatString()))
    local player tp = GetTriggerPlayer()
    if color == "green" then
        call SetPlayerColorDK(tp,PLAYER_COLOR_GREEN)
    elseif color == "red" then
        call SetPlayerColorDK(tp,PLAYER_COLOR_RED)
    elseif color == "blue" then
        call SetPlayerColorDK(tp,PLAYER_COLOR_BLUE)
    elseif color == "aqua" or color == "dark green" or color == "dgreen" then
        call SetPlayerColorDK(tp,PLAYER_COLOR_AQUA)
    elseif color == "brown" then
        call SetPlayerColorDK(tp,PLAYER_COLOR_BROWN)
    elseif color == "light blue" or color == "lblue" then
        call SetPlayerColorDK(tp,PLAYER_COLOR_LIGHT_BLUE)
    elseif color == "orange" then
        call SetPlayerColorDK(tp,PLAYER_COLOR_ORANGE)
    elseif color == "yellow" then
        call SetPlayerColorDK(tp,PLAYER_COLOR_YELLOW)
    elseif color == "purple" then
        call SetPlayerColorDK(tp,PLAYER_COLOR_PURPLE)
    elseif color == "pink" then
        call SetPlayerColorDK(tp,PLAYER_COLOR_PINK)
    elseif color == "cyan" or color == "teal" then
        call SetPlayerColorDK(tp,PLAYER_COLOR_CYAN)
    elseif color == "gray" then
        call SetPlayerColorDK(tp,PLAYER_COLOR_LIGHT_GRAY)
    endif
endfunction

//===========================================================================
function InitTrig_Change_Color takes nothing returns nothing
    set gg_trg_Change_Color = CreateTrigger(  )
    call TriggerRegisterAnyPlayerChatEventDK( gg_trg_Change_Color, "-color", false )
    call TriggerAddCondition(gg_trg_Change_Color,Condition(function Cond_Change_Color))
    call TriggerAddAction( gg_trg_Change_Color, function Trig_Change_Color_Actions )
endfunction



RE: I want this - 091846 - 2015-05-29

btanks are pretty dead , i dont see any new tanks update or bugs fixing


RE: I want this - RaptorXI - 2015-05-29

Nah, if the league bots die, we can still move to ENT.