HOST detection for map making

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

Post Reply
Trollkopp
Newcomer
Posts: 1
Joined: February 18th, 2007, 4:34 am

HOST detection for map making

Post by Trollkopp »

create a new TRIGGER named 'host'
change it to own text / script
create a Variable named 'Host' / type - PLAYER

copy this script :

function Trig_host_Actions 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

//===========================================================================
function InitTrig_host takes nothing returns nothing
set gg_trg_host = CreateTrigger( )
call TriggerAddAction( gg_trg_host, function Trig_host_Actions )
endfunction

script starts at mapinitialisation and the variable 'Host' is then hosting Player.

BEWARE: somtimes the HOST change during load, so that fastest PC get HOST function
(thx to dekar)

mfg
Trollkopp
everything is relativ <--- this too
Kala-cha
Forum Addict
Posts: 405
Joined: February 17th, 2007, 9:16 pm

Post by Kala-cha »

What's this for?
(Edit) Oh, for map making (-_-)
(Edit2) This is in JASS, put this in the JASS section, not the GUI sections
Post Reply