Jump to content

Respawn


Erik3R

Recommended Posts

Hi, some maps have respawn with timeleft, and i am too lazy to manually change it from the meta.xml file, so is there a way to stop it from onPlayerWasted function? help!

function RaceMode:onPlayerWasted(player) 
    if not self.checkpointBackups[player] then 
        return 
    end 
    TimerManager.destroyTimersFor("checkpointBackup",player) 
    if RaceMode.getMapOption('respawn') == 'timelimit' and not RaceMode.isPlayerFinished(source) then 
        -- See if its worth doing a respawn 
        local respawnTime       = RaceMode.getMapOption('respawntime') 
        if self:getTimeRemaining() - respawnTime > 3000 then 
            Countdown.create(respawnTime/1000, restorePlayer, 'You will respawn in:', 255, 255, 255, 0.25, 2.5, true, self.id, player):start(player) 
        end 
        if RaceMode.getMapOption('respawntime') >= 5000 then 
            TimerManager.createTimerFor("map",player):setTimer(clientCall, 2000, 1, player, 'Spectate.start', 'auto') 
        end 
    end 
    if g_MapOptions.respawn == 'none' then 
        removeActivePlayer( player ) 
        TimerManager.createTimerFor("map",player):setTimer(clientCall, 2000, 1, player, 'Spectate.start', 'auto') 
        if getActivePlayerCount() < 1 and g_CurrentRaceMode.running then 
            RaceMode.endMap() 
        end 
    end 
end 
  

Link to comment

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...