Kenix Posted December 8, 2010 Share Posted December 8, 2010 Help please I want to make a round from what to me to begin? I want to make round time, the round end (what team has won) and after that joins next map. Link to comment
12p Posted December 8, 2010 Share Posted December 8, 2010 We won't tell you the whole way to do it, you must script it by yourself, or pay with $$$ somebody so he will script it. But you could use these functions: setTimer getElementHealth getElementsByType getTeamName outputChatBox, guiCreateLabel, dxDrawText getPlayersInTeam PS: These functions doesn't work by themselves, you must learn how to use them. PS2: Click on each one to learn about them. Link to comment
Kenix Posted December 16, 2010 Author Share Posted December 16, 2010 I here have made a script but it doesn't work. = ( help me please. Here my script g_Root = getRootElement() local g_TimeLimit,g_MissionTimer local mapTimers = {} local defaults = { timeLimit = 300, } function zmMapStart(resource,mapRoot) local resourceName = getResourceName ( resource ) g_TimeLimit = (tonumber(get(resourceName..".time_limit")) and math.floor(tonumber(get(resourceName..".time_limit"))) or defaults.timeLimit)*1000 end addEventHandler ( "onGamemodeMapStart", g_Root, zmMapStart ) function startGame() g_MissionTimer = exports.missiontimer:createMissionTimer (g_TimeLimit,true,true,0.5,20,true,"default-bold",1) addEventHandler ( "onMissionTimerElapsed", g_MissionTimer, onTimeElapsed ) end function Endgame(winner,draw) for i,timer in ipairs(mapTimers) do if isTimer ( timer ) then killTimer ( timer ) end end mapTimers = {} destroyElement(g_MissionTimer) setTimer ( reboot, 15000, 1 ) if not winner then if draw then for i,player in ipairs(getElementsByType"player") do toggleAllControls(player,true,true,false) exports.scoreboard:setPlayerScoreboardForced ( player, true ) fadeCamera(player,false,10,0,0,0) end local zombwintextDis = textCreateDisplay () local zombwiitem = textCreateTextItem(getTeamName(winner).."Выживших не осталось. Зомби победили!", 0.5, 0.5, "low", 255, 0, 0, 255, 3, "center", "center" ) textDisplayAddText ( zombwitextDis, zombwiitem ) textDisplayAddObserver ( zombwitextDis, source ) setTimer ( textDestroyTextItem, 4000, 1, zombwiitem ) setTimer ( textDestroyDisplay, 4000, 1, zombwitextDis ) return else return end end for i,player in ipairs(getElementsByType"player") do if player ~= winner then setCameraTarget(player,winner) toggleAllControls(player,true,true,false) end exports.scoreboard:setPlayerScoreboardForced ( player, true ) fadeCamera(player,false,10,0,0,0) end local surwintextDis = textCreateDisplay () local surwinitem = textCreateTextItem(getTeamName(winner).."Выжившие победили! Они пережили нападение", 0.5, 0.5, "low", 255, 0, 0, 255, 3, "center", "center" ) textDisplayAddText ( surwintextDis, surwinitem ) textDisplayAddObserver ( surwintextDis, source ) setTimer ( textDestroyTextItem, 4000, 1, surwinitem ) setTimer ( textDestroyDisplay, 4000, 1, surwintextDis ) end function reboot() for i,player in ipairs(getElementsByType"player") do exports.scoreboard:setPlayerScoreboardForced ( player, false ) end zmMapStart(g_MapResource,g_MapRoot) end function isTimer ( timer ) for i,v in ipairs(getTimers()) do if timer == v then return true end end return false end no errors in debugscript. Link to comment
12p Posted December 16, 2010 Share Posted December 16, 2010 debug by yourself! For example, on every event use this function: outputChatBox ("the X event works!")--X = event name huh! Link to comment
Kenix Posted December 16, 2010 Author Share Posted December 16, 2010 Enormous thanks the dude! 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