Sex* Posted April 2, 2013 Posted April 2, 2013 So i have many maps that have in meta.xml respawn and removing them manually would be a pain in the ass, so can i override that respawn that it goes to random? Im not asking a full script, just functions for it.
tosfera Posted April 2, 2013 Posted April 2, 2013 You want to have random cars spawned all over the place? Well the easiest thing is to use a math.random to get the X, Y's. And to place them into the xml first open and unload it; math.random xmlLoadFile xmlUnloadFile xmlNodeGetAttribute xmlNodeGetValue xmlNodeSetAttribute xmlNodeSetValue
Sex* Posted April 2, 2013 Author Posted April 2, 2013 OMFG no, i mean gamemode race, some mapper puts into his map respawn, but i have like alot of race maps that have respawn on them, so i want to make a script that disables the respawn in all of the maps(DM, DD, FUN maps).
ZL|LuCaS Posted April 2, 2013 Posted April 2, 2013 you need to edit your race.zip base.lua 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
ZL|LuCaS Posted April 3, 2013 Posted April 3, 2013 Thanks, figured it out and works great! You're welcome.
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