wc3edit.net
https://forum.wc3edit.net/

HOST detection for map making
http://forum.wc3edit.net/deprotection-cheating-f64/host-detection-for-map-making-t360.html
Page 1 of 1

Author:  Trollkopp [ March 19th, 2007, 7:37 am ]
Post subject:  HOST detection for map making

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

Author:  Kala-cha [ March 19th, 2007, 10:54 pm ]
Post subject: 

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

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/