Kenix Posted February 6, 2011 Share Posted February 6, 2011 there is a problem with the resource missiontimer When the timer starts next / map strays that have to do to the timer does not strayed? I wish that the time is not continued and began to re- Here's the script. function loadmap() local resourceName = getResourceName ( resource ) g_TimeLimit = (tonumber(get(resourceName..".time_limit")) and math.floor(tonumber(get(resourceName..".time_limit"))) or defaults.timeLimit)*1000 g_MissionTimer = exports.missiontimer:createMissionTimer (g_TimeLimit,true,true,0.5,20,true,"default-bold",1) addEventHandler ( "onMissionTimerElapsed", g_MissionTimer, onTimeElapsed ) end addEventHandler("onGamemodeMapStart",getRootElement(), loadmap) function stopmap() removeEventHandler ( "onMissionTimerElapsed", g_MissionTimer, onTimeElapsed ) end addEventHandler("onGamemodeMapStop",getRootElement(),stopmap) Link to comment
Castillo Posted February 6, 2011 Share Posted February 6, 2011 I don't understand what do you mean Link to comment
Kenix Posted February 6, 2011 Author Share Posted February 6, 2011 I don't understand what do you mean ok explain to another I want to after you finished maps timer starts curtain Link to comment
Kenix Posted February 6, 2011 Author Share Posted February 6, 2011 still does not work local g_MissionTimer,g_TimeLimit function loadmap() local resourceName = getResourceName ( resource ) g_TimeLimit = (tonumber(get(resourceName..".time_limit")) and math.floor(tonumber(get(resourceName..".time_limit"))) or defaults.timeLimit)*1000 g_MissionTimer = exports.missiontimer:createMissionTimer (g_TimeLimit,true,true,0.5,20,true,"default-bold",1) addEventHandler ( "onMissionTimerElapsed", g_MissionTimer, onTimeElapsed ) end addEventHandler("onGamemodeMapStart",getRootElement(), loadmap) function stopmap() removeEventHandler ( "onMissionTimerElapsed", g_MissionTimer, onTimeElapsed ) destroyElement(g_MissionTimer,g_TimeLimit) end addEventHandler("onGamemodeMapStop",getRootElement(),stopmap) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now