- Joined
- Mar 20, 2007
- Messages
- 224
Alright; I want to make a trigger that will instantly desync a player (the victim) from a game.
That's my current script; not very clean, and although it works, it does not work well - it is not instantaneous desync according to my tests.
Can anyone help me write something better and more guaranteed?
(Also, how to check how many human players in a game still there?)
JASS:
function desyncPlayer takes integer victim returns nothing
local unit array u
local integer i = 0
if GetLocalPlayer() != Player(victim) then
loop
set u[i] = CreateUnit(Player(0), 'h000', 0, 0, 0)
exitwhen i == victim
set i = i + 1
endloop
endif
set i = 0
loop
call RemoveUnit(u[i])
set u[i] = null
exitwhen i == 24
set i = i + 1
endloop
endfunction
That's my current script; not very clean, and although it works, it does not work well - it is not instantaneous desync according to my tests.
Can anyone help me write something better and more guaranteed?
(Also, how to check how many human players in a game still there?)