SetPlayerAlliance()

AoW_Hun7312

I'm a magic man, I've got magic hands.
Reaction score
76
What is "value" in SetPlayerAlliance() used for?

JASS:
native SetPlayerAlliance takes player sourcePlayer, player otherPlayer, alliancetype whichAllianceSetting, boolean value returns nothing


EDIT: I'm trying to set two forces to be enemies/allies. Am I using this function correctly?

JASS:
    function setAlliance takes player tagger returns nothing
        local player p = GetLocalPlayer()
        if (p != tagger) then
            if (IsPlayerInForce(p, forceRunners)) then
                SetPlayerAlliance(tagger, p, bj_ALLIANCE_UNALLIED, true)
                SetPlayerAlliance(p, tagger, bj_ALLIANCE_UNALLIED, true)
            endif
            if (IsPlayerInForce(p, forceTaggers)) then
                SetPlayerAlliance(tagger, p, bj_ALLIANCE_ALLIED_VISION, true)
                SetPlayerAlliance(p, tagger, bj_ALLIANCE_ALLIED_VISION, true)
            endif
        endif
    endfunction
 

Laiev

Hey Listen!!
Reaction score
188
ya but i don't remember what is the boolean (value)

i think is share units... idk :S
 

AoW_Hun7312

I'm a magic man, I've got magic hands.
Reaction score
76
Another noob mistake on my part. After I added calls in front of those lines, it gives me a new error: "cannot convert integer to alliance type".
 

Laiev

Hey Listen!!
Reaction score
188
JASS:
function setAlliance takes player tagger returns nothing
        local player p = GetLocalPlayer() //why are you using local player? lol
        if (p != tagger) then
            if (IsPlayerInForce(p, forceRunners)) then
                call SetPlayerAlliance(tagger, p, ALLIANCE_SHARED_VISION, false)
                call SetPlayerAlliance(p, tagger, ALLIANCE_SHARED_VISION, false)
            endif
            if (IsPlayerInForce(p, forceTaggers)) then
                call SetPlayerAlliance(tagger, p, ALLIANCE_SHARED_VISION, true)
                call SetPlayerAlliance(p, tagger, ALLIANCE_SHARED_VISION, true)
            endif
        endif
    endfunction


the bj return 4 natives with all value false... i think it's ok use this bj... i don't remeber the other alliancetype to enemy :x

will search and edit here, one second

edited.
 

AoW_Hun7312

I'm a magic man, I've got magic hands.
Reaction score
76
JASS:
function setAlliance takes player tagger returns nothing
        local player p = GetLocalPlayer() //why are you using local player? lol
        if (p != tagger) then
            if (IsPlayerInForce(p, forceRunners)) then
                call SetPlayerAlliance(tagger, p, ALLIANCE_SHARED_VISION, false)
                call SetPlayerAlliance(p, tagger, ALLIANCE_SHARED_VISION, false)
            endif
            if (IsPlayerInForce(p, forceTaggers)) then
                call SetPlayerAlliance(tagger, p, ALLIANCE_SHARED_VISION, true)
                call SetPlayerAlliance(p, tagger, ALLIANCE_SHARED_VISION, true)
            endif
        endif
    endfunction


the bj return 4 natives with all value false... i think it's ok use this bj... i don't remeber the other alliancetype to enemy :x

will search and edit here, one second

edited.

What should I use instead of local player?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top