• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[JASS] Team Kills...

Status
Not open for further replies.
Level 29
Joined
Mar 10, 2009
Messages
5,016
OK I have this setup...


JASS:
//An example of scoring system, if Player (1-3)(4-6)(7-9)(10-12) is the Killing unit...
//then the particular team will get the benefit...
 
function team1 takes unit a, unit b, player c returns boolean
    return IsUnitIllusion(a)==false and IsUnitEnemy(b, GetOwningPlayer(a)) and GetOwningPlayer(b)==Player(0) or GetOwningPlayer(b)==Player(1) or GetOwningPlayer(b)==Player(2)
endfunction
 
function team2 takes unit a, unit b, player c returns boolean
    return IsUnitIllusion(a)==false and IsUnitEnemy(b, GetOwningPlayer(a)) and GetOwningPlayer(b)==Player(3) or GetOwningPlayer(b)==Player(4) or GetOwningPlayer(b)==Player(5)
endfunction
 
function team3 takes unit a, unit b, player c returns boolean
    return IsUnitIllusion(a)==false and IsUnitEnemy(b, GetOwningPlayer(a)) and GetOwningPlayer(b)==Player(6) or GetOwningPlayer(b)==Player(7) or GetOwningPlayer(b)==Player(8)
endfunction
 
function team4 takes unit a, unit b, player c returns boolean
    return IsUnitIllusion(a)==false and IsUnitEnemy(b, GetOwningPlayer(a)) and GetOwningPlayer(b)==Player(9) or GetOwningPlayer(b)==Player(10) or GetOwningPlayer(b)==Player(11)
endfunction
 
function actiondeath takes nothing returns nothing
    local unit dying = GetTriggerUnit()
    local unit killing = GetKillingUnit()
    local player whoplayer = GetLocalPlayer()
    if team1(dying, killing, whoplayer) then
       call BJDebugMsg("OK1")
       set udg_Kill_Count1 = udg_Kill_Count1 + 1
       call DisplayTextToForce(GetPlayersAll(), "Team1= " + I2S(udg_Kill_Count1))
    elseif team2(dying, killing, whoplayer) then
       call BJDebugMsg("OK2")
       set udg_Kill_Count2 = udg_Kill_Count2 + 1
       call DisplayTextToForce(GetPlayersAll(), "Team2= " + I2S(udg_Kill_Count2))
    elseif team3(dying, killing, whoplayer) then
       call BJDebugMsg("OK3")
       set udg_Kill_Count3 = udg_Kill_Count3 + 1
       call DisplayTextToForce(GetPlayersAll(), "Team3= " + I2S(udg_Kill_Count3))
    elseif team4(dying, killing, whoplayer) then
       call BJDebugMsg("OK4")
       set udg_Kill_Count4 = udg_Kill_Count4 + 1
       call DisplayTextToForce(GetPlayersAll(), "Team4= " + I2S(udg_Kill_Count4))
    endif
    set dying = null
    set killing = null
    set whoplayer = null
endfunction
 
//===========================================================================
 
function InitTrig_dies takes nothing returns nothing
    local trigger t = CreateTrigger() 
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_DEATH)
    call TriggerAddAction(t, function actiondeath)  
    set t = null
endfunction


and I have only one question, are these functions NOT interfere with
each other?...
 
Status
Not open for further replies.
Top