ragingspeedhorn
Is a Banned Asshole
- Reaction score
- 94
Garbage.
Nevermind...
Nevermind...
function GetHostId takes nothing returns integer
//This stores the Id + 1 for each player.
call StoreInteger(GameCache(), "missionKey", "key", GetPlayerId(GetLocalPlayer()) + 1)
//Setup the TriggerSyncReady call.
call TriggerSyncStart()
//Sync the value of the entry for each player.
//Each value will sync to the value of the host.
call SyncStoredInteger(GameCache(), "missionKey", "key")
//Wait until the Game Cache syncs the key for everyone.
call TriggerSyncReady()
//Return the synced value as a id.
return GetStoredInteger(GameCache(), "missionKey", "key") - 1
endfunction
function GetHostAverage takes nothing returns nothing
local integer array id
local integer max = 0
local integer t = 0
local integer i = 0
set udg_Host = null
loop
exitwhen i > 11
set id<i> = 0
set i = i + 1
endloop
set i = 0
loop
exitwhen i > 5
set t = GetHostId()
set id[t] = id[t] + 1
if id[t] > id[max] then
set max = t
endif
set i = i + 1
call TriggerSleepAction(1)
endloop
set udg_Host = Player(max)
endfunction</i>
MrApples said:If anything this is free trigger code... but seems more like your having a problem with it and this is a help thread.