Page 1 of 1

Help about jass hostfinder

Posted: Sat Nov 22, 2008 4:17 pm
by ikillforeyou
ok so. i've found a script that finds the host and stores it onto a variable. :

Code: Select all

function GetHost takes nothing returns nothing
    local gamecache g = InitGameCache("Map.w3v")
    call StoreInteger ( g, "Map", "Host", GetPlayerId(GetLocalPlayer ())+1)
    call TriggerSyncStart ()
    call SyncStoredInteger ( g, "Map", "Host" )
    call TriggerSyncReady ()
    set udg_Host = Player( GetStoredInteger ( g, "Map", "Host" )-1)
    call FlushGameCache( g )
    set g = null
endfunction
the variable is "Host"
what i need it to do is when the host leaves it selects the new host and gives it the "admin tower"
that action is here is here:
Custom script: call GetHost()
Unit - Change ownership of Admin tower 0002 <gen> to Host and Change color
.
thats all if you can help me i would appreciate it :)

Re: Help about jass hostfinder

Posted: Sat Nov 22, 2008 5:16 pm
by 3ICE
Addt_all Trigger - Add to (This trigger) the event (Player - Host leaves the game)after the ownership changing.

Re: Help about jass hostfinder

Posted: Sat Nov 22, 2008 7:44 pm
by ikillforeyou
3ICE wrote:Addt_all Trigger - Add to (This trigger) the event (Player - Host leaves the game)after the ownership changing.
i know but what's all the trigger? like shouldn't i have to do the whole store integer thing again?

Re: Help about jass hostfinder

Posted: Sat Nov 22, 2008 8:01 pm
by 3ICE
By adding an event to (This trigger) you make the whole trigger run a second time as soon as the original host left.