jBoard Usage

Status
Not open for further replies.

Chaos_Knight

New Member
Reaction score
39
Okay, i just found the jBoard here. I fastly implented it, and i got the whole thing work.

But i wanted to check Player 1, Player 2, Player 3, Player 4, Player 5 and Player 6s kills.

I was thinking GUI, so..
I didnt came up to anything.

Does anyone have an idea how to make this?

//Chaos_Knight
 

tooltiperror

Super Moderator
Reaction score
231
I think this is what you want. Untested, but should work. Comes in two unique flavors!

JASS:

//vJASS
 library TrackKill initializer init
    globals
      integer array playerKills[12]
    endglobals
    private function RegisterKill takes nothing returns nothing
        local integer a=playerKills[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]
        set playerKills[a]=a+1
        set a=0
    endfunction
    private function init takes nothing returns nothing
        local trigger t=CreateTrigger()
        local integer a=-1
          loop
            set a=a+1
            call TriggerRegisterPlayerUnitEvent(t,Player(a),EVENT_PLAYER_UNIT_DEATH,null)
            exitwhen a==bj_MAX_PLAYER_SLOTS
          endloop
        call TriggerAddAction(t,function RegisterKill)
        set a=0
    endfunction
 endlibrary


JASS:

//Zinc
//! zinc
 library ZTrackKills
 {
      integer playerKills[12];
      
      function RegisterKills ()
      {
         integer a=playerKills[GetPlayerId(GetOwningPlayer(GetKillingUnit()))];
         playerKills[a]=a+1;
         a=0;
      }
      
      function onInit()
      {
         trigger t=CreateTrigger();integer a=-1;
         while(a<bj_MAX_PLAYER_SLOTS)
           {
             a=a+1;
             TriggerRegisterPlayerUnitEvent(t,Player(a),EVENT_PLAYER_UNIT_DEATH,null);
           }
         TriggerAddAction(t,function RegisterKills);
         a=0;
      }
 }
 //! endzinc
 

Trollvottel

never aging title
Reaction score
262
JASS:

 library TrackKill initializer init
    globals
      integer array playerKills[12]
    endglobals
    private function RegisterKill takes nothing returns nothing // call this function failfunction
        local integer a=playerKills[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]
        set playerKills[a]=a+1
        set a=0
    endfunction
    private function init takes nothing returns nothing
        local trigger t=CreateTrigger()
        local integer a=-1
          loop
            set a=a+1
            call TriggerRegisterPlayerUnitEvent(t,Player(a),EVENT_PLAYER_UNIT_DEATH,null)
            exitwhen a==bj_MAX_PLAYER_SLOTS
          endloop
        call TriggerAddAction(t,function RegisterKill)
        set a=0
    endfunction
 endlibrary

registerkill will not work. not hard to see why >.>
 

Chaos_Knight

New Member
Reaction score
39
But making it in the jBoard func?
JASS:
//! textmacro jBoardCreate takes NAME, ROWS, COLS

Using this?
 
Status
Not open for further replies.
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top