if ( CLIENT ) then
print("||retry system loaded!||")
function didwecrash() -- client auto ran crash checker
if (not timer.IsTimer("didwecrash")) then
wedidcrashdamit = true
timer.Create("didwecrash", 20, 1,function()
if (not wedidcrashdamit == nil) and wedidcrashdamit then
print("we should be rejoing now")
RunConsoleCommand("connect 50.31.65.166:27015")
end
end)
timer.start("didwecrash")
end
if (not wedidcrashdamit) then
timer.stop( "didwecrash" )
timer.Destroy( "didwecrash" )
timer.Create("didwecrash",20,1,function() -- creates a timer that restarts if true
print("we should be rejoing now")
RunConsoleCommand("connect 50.31.65.166:27015")
end)
timer.start("didwecrash")
end
end
hook.Add("Think",didwecrash,wecrashed)
local function RecvMyUmsg( data )
wedidcrashdamit = data:ReadBool()
end
usermessage.Hook( "didwecrash", RecvMyUmsg );
end
if ( SERVER ) then
function sdidwecrash()
if (not timer.IsTimer("sendcrashinfop")) then
timer.simple("sendcrashinfop", 10, 0,function()
umsg.Start( "didwecrash" )
umsg.Bool( false )
umsg.End()
end)
end
timer.start("sendcrashinfop")
end
end
hook.Add("Think",sdidwecrash,swecrashed)
this clearly does not work i think timers are synced with the server :/