• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Force UI key

Status
Not open for further replies.
Level 3
Joined
Nov 2, 2020
Messages
28
  • Game - Force SomePlayer to press the key SomeKey
This action seems to work fine for human players, but for computer players, it does not work. Anybody know why?
 
It does not work because the choosen player is used for GetLocalPlayer() comparison. No LocalPlayer is equal to a Warcraft Bot
JASS:
function ForceUIKeyBJ takes player whichPlayer, string key returns nothing
    if (GetLocalPlayer() == whichPlayer) then
        // Use only local code (no net traffic) within this block to avoid desyncs.
        call ForceUIKey(key)
    endif
endfunction
 
Status
Not open for further replies.
Top