• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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