Daeron Posted April 1, 2012 Share Posted April 1, 2012 How can i put it like , next map doesn't start till everyone is dead ... right now when there are 2 players , 1 dies , next map starts , but how can i put it like next map wont start till the 2nd player is dead too? Link to comment
0 Jaysds1 Posted April 8, 2012 Share Posted April 8, 2012 (edited) try this: addEventHandler("onPlayerWasted",root,function() if not getAlivePlayers() then triggerEvent("onRoundFinished",resourceRoot) end end) Edited April 9, 2012 by Guest Link to comment
0 Jaysds1 Posted April 9, 2012 Share Posted April 9, 2012 I've edit it, copy it and try it again. Link to comment
0 Daeron Posted April 10, 2012 Author Share Posted April 10, 2012 still didnt work , maybe u can send me the script and meta file ? maybe i did something wrong Link to comment
0 Daeron Posted April 10, 2012 Author Share Posted April 10, 2012 anyone got more ideas? Link to comment
0 Jaysds1 Posted April 10, 2012 Share Posted April 10, 2012 I'm going to look more into the script right now... Link to comment
0 Daeron Posted April 14, 2012 Author Share Posted April 14, 2012 anyone else knows how to do this??? Link to comment
0 Daeron Posted April 16, 2012 Author Share Posted April 16, 2012 ????????????????????? anyone ???????????????????????? Link to comment
0 Jaysds1 Posted April 16, 2012 Share Posted April 16, 2012 I am going to direct you to a Scripting Expert: Solidsnake13 Link to comment
0 MIKI785 Posted April 18, 2012 Share Posted April 18, 2012 LoL, he,s talking about the race... he didn't write it but I know it.. Go to your race folder, then go to the modes folder and you will see destructionderby.lua, edit it, replace it with the following code: DestructionDerby = setmetatable({}, RaceMode) DestructionDerby.__index = DestructionDerby mode = 1 DestructionDerby:register('Destruction derby') function DestructionDerby:isApplicable() return not RaceMode.checkpointsExist() and RaceMode.getMapOption('respawn') == 'none' or RaceMode.getMapOption('respawn') == 'timelimit' end function DestructionDerby:getPlayerRank(player) return #getActivePlayers() end -- Copy of old updateRank function DestructionDerby:updateRanks() for i,player in ipairs(g_Players) do if not isPlayerFinished(player) then local rank = self:getPlayerRank(player) if not rank or rank > 0 then setElementData(player, 'race rank', rank) end end end -- Make text look good at the start if not self.running then for i,player in ipairs(g_Players) do setElementData(player, 'race rank', '' ) setElementData(player, 'checkpoint', '' ) end end end function DestructionDerby:onPlayerWasted(player) if isActivePlayer(player) then self:handleFinishActivePlayer(player) if getActivePlayerCount() <= mode then RaceMode.endMap() else TimerManager.createTimerFor("map",player):setTimer(clientCall, 2000, 1, player, 'Spectate.start', 'auto') end end RaceMode.setPlayerIsFinished(player) showBlipsAttachedTo(player, false) end function DestructionDerby:onPlayerQuit(player) if isActivePlayer(player) then self:handleFinishActivePlayer(player) if getActivePlayerCount() <= mode then RaceMode.endMap() end end end function DestructionDerby:handleFinishActivePlayer(player) -- Update ranking board for player being removed if not self.rankingBoard then self.rankingBoard = RankingBoard:create() self.rankingBoard:setDirection( 'up', getActivePlayerCount() ) end local timePassed = self:getTimePassed() self.rankingBoard:add(player, timePassed) -- Do remove finishActivePlayer(player) -- Update ranking board if one player left local activePlayers = getActivePlayers() if #activePlayers == 1 then self.rankingBoard:add(activePlayers[1], timePassed) showMessage(getPlayerName(activePlayers[1]) .. ' je KING!', 255, 255, 0) exports.mikiserver:checkWinAndIfWinGiveWinCash(activePlayers[1]) end end ------------------------------------------------------------ -- activePlayerList stuff -- function isActivePlayer( player ) return table.find( g_CurrentRaceMode.activePlayerList, player ) end function addActivePlayer( player ) table.insertUnique( g_CurrentRaceMode.activePlayerList, player ) end function removeActivePlayer( player ) table.removevalue( g_CurrentRaceMode.activePlayerList, player ) end function finishActivePlayer( player ) table.removevalue( g_CurrentRaceMode.activePlayerList, player ) table.insertUnique( g_CurrentRaceMode.finishedPlayerList, _getPlayerName(player) ) end function getFinishedPlayerCount() return #g_CurrentRaceMode.finishedPlayerList end function getActivePlayerCount() return #g_CurrentRaceMode.activePlayerList end function getActivePlayers() return g_CurrentRaceMode.activePlayerList end function changeMode (player, command) if hasObjectPermissionTo ( player , "function.kickPlayer", false ) then if (mode == 1) then mode = 0 outputChatBox("#8ED2FFAdministrator #BDE4FF" .. getPlayerName(player) .. " #8ED2FFpovolil funkci -Vitez mapu dojizdi!- .", getRootElement(), 250,0,0, true ) else mode = 1 outputChatBox("#8ED2FFAdministrator #BDE4FF" .. getPlayerName(player) .. " #8ED2FFvypnul funkci -Vitez mapu dojizdi!- .", getRootElement(), 250,0,0, true ) end else outputChatBox("** Nemas dostatecny admin Level!!", player,250,0,0) end msg = "MODE: " outputServerLog( msg .. mode ) end addCommandHandler("mode", changeMode) addEvent("toggleMode", true) addEventHandler("toggleMode", getRootElement(), changeMode) You will have a command /mode to chagne this, if the player can finish or not.. just change the strings at the end of the code to your own language, if you know basics of the scripting you should know what is going on there Link to comment
0 Daeron Posted April 18, 2012 Author Share Posted April 18, 2012 OMG Thanks Miki785 , finally someone helped me Link to comment
0 Phat Looser Posted April 18, 2012 Share Posted April 18, 2012 Tell the people which gamemode you are running first, dude. Link to comment
Question
Daeron
How can i put it like , next map doesn't start till everyone is dead ...
right now when there are 2 players , 1 dies , next map starts , but how can i put it like next map wont start till the 2nd player is dead too?
Link to comment
39 answers to this question
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