• 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.

Ask Host Detection

Status
Not open for further replies.
That snippet ragingspeedhorn posted will fail.
He has to do it like this:

JASS:
function GetHost takes nothing returns nothing
    local gamecache g = InitGameCache("Map.w3v")
    call StoreInteger(g, "Map", "Host", GetPlayerId(GetLocalPlayer()))
    call TriggerSyncStart()
    call SyncStoredInteger(g, "Map", "Host")
    call TriggerSyncReady()
    set udg_Host = Player(GetStoredInteger(g, "Map", "Host"))
    call FlushGameCache(g)
    set g = null
endfunction

function InitTrig_HostGet takes nothing returns nothing
    call FlushGameCache(InitGameCache("Map.w3v"))
endfunction

Else, the gamecache will be null.
 
Last edited:
Status
Not open for further replies.
Top