• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

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