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