LiTtLe_LiOn
Active Member
- Reaction score
- 0
as title
please someone help~~
please someone help~~
Add this into map header
Code:
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
endfunctionMap Header = The most top thing in the Triggers List, place the code under where you write the comment, NOT ON THE COMMENT.
Then make this trigger
Code:
Custom script: call GetHost()
PS:
I did not write this code, ragingspeedhorn (of hiveworkshop.com) did.. Credit him for making it ^_^..
[B][I]Custom Script[/I][/B]
[B]Events[/B]
Map initialization
[B]Conditions[/B]
[B]Actions[/B]
Custom script: call GetHost()
[B][I]Host[/I][/B]
[B]Events[/B]
Time - Elapsed game time is <any value> seconds
[B]Conditions[/B]
[B]Actions[/B]
Game - Display to (All players) the text: (The host has been detected as + ((Name of Host) + |r))
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
Host
Events
Time - Elapsed game time is <any value> seconds
Conditions
Actions
Game - Display to (All players) the text: (The host has been detected as + ((Name of Host) + |r))
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
Host
Events
Map initialization
Conditions
Actions
Custom script: [COLOR="Red"]Custom script:[/COLOR] call GetHost()