Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: how to end a map?

  1. #1
    Senior Member nene81's Avatar
    Join Date
    Nov 2014
    Location
    Seville, SPAIN
    Posts
    193

    Default how to end a map?

    Hi mates!

    I'm looking for a way for ending a map without using "ron map XXX" ( "rcon map" method doesn't load XXX.scr file. )

    I would call through admin_cmd or similar

    I'm thinking some method similar at "timelimit" ( when timelimit is ended, map changes )

    I was looking Elgan's countdown mod, he uses camera.scr, I took some things end I tried below but didn't work:

    Cmd_FINALIZE.scr:
    Code:
    main:
    
    //	self respawn
    	$player hide
    	freezeplayer $player
    
    //	teamwin local.dmteam
    
    	cueplayer
    
    	self iprint "-----> ending map" 1
    
    	releaseplayer $player
    
    end
    Some information about "timelimit" is ended automatically?

    THX

  2. #2

    Default

    Its been that long since i messed around with servers i forget all the commands, if you are going to use "rcon timelimit 1" be sure to wait a few seconds and then do "rcon timelimit X" (X = your maps correct timelimit) or it will set every maps timelimit to 1.

  3. #3
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,603

    Default

    Too lazy to write how from my phone.
    Sor can help in these situations.

  4. #4
    Senior Member nene81's Avatar
    Join Date
    Nov 2014
    Location
    Seville, SPAIN
    Posts
    193

    Default

    Thanks mates.

    Timelimilt is only an example.

    I need a way of ending the map when I want in any moment, no matter which way.
    Last edited by nene81; January 9th, 2016 at 12:18 PM.

  5. #5
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,603

    Default

    Quote Originally Posted by Cobra {sfx} View Post
    Its been that long since i messed around with servers i forget all the commands
    Found it.
    The funny thing is that cobra is the one who posted it xD.
    http://www.old.mods-r-us.net/forums.php?m=posts&q=2448
    Here is an edited script to suit ur needs.

    changemapah:

    local.tomap = "dm/urmaphere"
    setcvar "nextmap" local.tomap
    waitthread timer local.tomap
    local.manager = spawn DM_Manager
    local.manager dobsptransition nextmap

    end
    timer local.tomap:
    for (local.countdown = 5; local.countdown > 0;local.countdown--)
    {
    iprintln ("Changing map to " + local.tomap + " in: " + local.countdown + " seconds!")
    wait 1
    }
    end

  6. #6

    Default

    Hmmm Christmas eve 2005 ... 11yr old post, can vaguely remember using it in The Hunt for some reason ... However that was used to end the round as soon as the map loads and restart it again - was using it to cache something, the edited version above outta do the trick tho.

  7. #7
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,603

    Default

    Solid memory cobs 😃😃😃😃

  8. #8
    Developer Sor's Avatar
    Join Date
    Aug 2010
    Location
    The Medieval City of Bruges
    Posts
    747

    Default

    Why wouldn't 'rcon map' work? You're using reborn, right? So you can use the 'stuffsrv' command to access the server command line:
    stuffsrv "map dm/mohdm7";


    The old way would be to use 'leveltransition' or 'bsptransition', the difference being that 'bsptransition' retains the players' loadout (and even health in single player) while 'leveltransition' puts everyone in spectator mode again.
    local.gametype = getcvar "g_gametype";
    setcvar "g_gametype" "0";

    setcvar "nextmap" "dm/mohdm7";
    leveltransition nextmap;

    setcvar "g_gametype" local.gametype;

    Interestingly, if the 'nextmap' cvar is empty, it will simply change to the next map in the map rotation. If the current map isn't part of the rotation, it switches to the first map. Also, if the 'nextmap' cvar points to the current map, the current map is not reloaded, it is simply restarted.
    Morpheus Script (MoH) => You try to shoot yourself in the foot only to discover that MorpheusScript already shot your foot for you.

  9. #9
    Senior Member nene81's Avatar
    Join Date
    Nov 2014
    Location
    Seville, SPAIN
    Posts
    193

    Default

    Thank you very much Sor & Ryback, it worked.

    I couldn't use reborn, it was a script for Spearhead.

    Code:
    main:
    	self iprint "----->ENDING MAP" 1
    
    	wait 0.2
    
    	local.gametype = getcvar "g_gametype"
    
    	setcvar "g_gametype" "0"
    
    	setcvar "nextmap" ""	//next in sv_maplist
    
    	leveltransition nextmap
    
    	setcvar "g_gametype" local.gametype
    end
    I call te script from JimPunishment comfortably.

    And I was wrong, XXX.scr is loaded correctly with "rcon map dm/XXXX".
    I couldn't hear the ambient.mus and I though that XXX.scr it wasn't loaded, but my s_musicvolume was too low.

  10. #10
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,603

    Default

    Ah sor BTW what's the difference between level transition cmd and dmmanager method? Determining next map ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •