Jump to content

Auto B


MuStAfA

Recommended Posts

pls help me !!

my race file have auto b

but my server is dd + dm

in dd maps anyone wons so there is auto b

how to remove it?

this is my code

estructionDerby = setmetatable({}, RaceMode) 
DestructionDerby.__index = DestructionDerby 
  
DestructionDerby:register('Destruction derby') 
  
function DestructionDerby:isApplicable() 
    return not RaceMode.checkpointsExist() and RaceMode.getMapOption('respawn') == 'none' 
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() <= 0 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() <= 1 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]) .. ' Won This Round !!!', 30, 144, 255) 
    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 
  
  

Link to post

Try this:

DestructionDerby = setmetatable({}, RaceMode) 
DestructionDerby.__index = DestructionDerby 
  
DestructionDerby:register('Destruction derby') 
  
function DestructionDerby:isApplicable() 
    return not RaceMode.checkpointsExist() and RaceMode.getMapOption('respawn') == 'none' 
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) 
        local map = exports.mapmanager:getRunningGamemodeMap() 
        local name = getResourceInfo(map,'name') 
        if not name:find('[DD]',1,true) then 
            if getActivePlayerCount() <= 0 then 
                RaceMode.endMap() 
            else 
                TimerManager.createTimerFor("map",player):setTimer(clientCall, 2000, 1, player, 'Spectate.start', 'auto') 
            end 
        else 
            if getActivePlayerCount() <= 1 then 
                RaceMode.endMap() 
            else 
                TimerManager.createTimerFor("map",player):setTimer(clientCall, 2000, 1, player, 'Spectate.start', 'auto') 
            end 
        end 
    end 
    RaceMode.setPlayerIsFinished(player) 
    showBlipsAttachedTo(player, false) 
end 
  
function DestructionDerby:onPlayerQuit(player) 
    if isActivePlayer(player) then 
        self:handleFinishActivePlayer(player) 
        if getActivePlayerCount() <= 1 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() 
    local map = exports.mapmanager:getRunningGamemodeMap() 
    local name = getResourceInfo(map,'name') 
    if not name:find('[DD]',1,true) then 
        if #activePlayers == 0 then 
            self.rankingBoard:add(activePlayers[1], timePassed) 
            showMessage(getPlayerName(activePlayers[1]) .. ' Won This Round !!!', 30, 144, 255) 
        end 
    else 
        if #activePlayers == 1 then 
            self.rankingBoard:add(activePlayers[1], timePassed) 
            showMessage(getPlayerName(activePlayers[1]) .. ' Won This Round !!!', 30, 144, 255) 
        end 
    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 
  
  
  

Edited by Guest
Link to post
Try this:
estructionDerby = setmetatable({}, RaceMode) 
DestructionDerby.__index = DestructionDerby 
  
DestructionDerby:register('Destruction derby') 
  
function DestructionDerby:isApplicable() 
    return not RaceMode.checkpointsExist() and RaceMode.getMapOption('respawn') == 'none' 
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() <= 0 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() <= 1 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() 
    local map = exports.mapmanager:getRunningGamemodeMap() 
    local name = getResourceInfo(map,'name') 
    if not name:find('[DD]',1,true) then 
    if #activePlayers == 0 then 
        self.rankingBoard:add(activePlayers[1], timePassed) 
        showMessage(getPlayerName(activePlayers[1]) .. ' Won This Round !!!', 30, 144, 255) 
    end 
    else 
    if #activePlayers == 1 then 
        self.rankingBoard:add(activePlayers[1], timePassed) 
        showMessage(getPlayerName(activePlayers[1]) .. ' Won This Round !!!', 30, 144, 255) 
    end 
    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 
  
  

didnt work

Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...