(01-17-2014, 02:27 AM)STR_Warrior Wrote: I'm guessing you only changed the OnScheduleTick function. Could I see that code?
I made 2 hooks for Lobby and Start.
Code:
function AddLobbySchedule(Function, Parameters, Ticks)
table.insert(LobbyScheduleTable, {Function, Parameters, Ticks})
end
function OnLobbyScheduleTick(Time)
for Idx, ScheduleTask in pairs(LobbyScheduleTable) do
LobbyScheduleTable[Idx][3] = LobbyScheduleTable[Idx][3] - 1 -- Countdown
if ScheduleTask[3] < 1 then
ScheduleTask[1](ScheduleTask[2])
LobbyScheduleTable[Idx] = nil
end
end
end
function AddStartSchedule(Function, Parameters, Ticks)
table.insert(StartScheduleTable, {Function, Parameters, Ticks})
end
function OnStartScheduleTick(Time)
for Idx, ScheduleTask in pairs(StartScheduleTable) do
StartScheduleTable[Idx][3] = StartScheduleTable[Idx][3] - 1 -- Countdown
if ScheduleTask[3] < 1 then
ScheduleTask[1](ScheduleTask[2])
StartScheduleTable[Idx] = nil
end
end
end
cPluginManager.AddHook(cPluginManager.HOOK_TICK, OnLobbyScheduleTick);
cPluginManager.AddHook(cPluginManager.HOOK_TICK, OnStartScheduleTick);