// No middle-round spawning // Script addon for EventScripts 1.5 by GODJonez // // Version: 1.0 // Release date: 2007-09-19 // Updated date: 2007-09-19 // // *************************** // Installation: // 1. Create a new folder called 'nomidspawn' under addons/eventscripts // 2. Copy this file to that new folder // 3. Load the script (see below) // // If you want this script to load automatically: // 1. Open cfg/autoexec.cfg // 2. Add line 'es_load nomidspawn' to the file // 3. Save the file and (re)start server // // If you want to load this script while the server is running: // - Using client console: // Type in the console 'rcon es_load nomidspawn' // - Using HLSW or server console: // Type in 'es_load nomidspawn' // // You can also unload this script at any time by replacing // 'es_load' with 'es_unload' in the above commands. // // **************************** // CONFIGURATION: // You can either configure this script by either: // - editing the block config below // - editing autoexec.cfg or server.cfg // // If you configure using a cfg file or the server console, // the variables (and their default values) are: // // nms_spawntime 5.0 // - the number of seconds from the beginning of the round players // are allowed to join the game alive // // nms_ignorebots 1 // - set this to 1 to make this script ignore bots joining mid-game // - set this to 0 to make the spawn prevention apply to bots also // // nms_announce 0 // - set this to 0 to disable any announcements // - set this to 1 to display when a player was slain for late-spawning // - set this to 2 to display a text in round start to advertise script // - set this to 3 to display text for both 1 and 2 block config { nms_spawntime 5.0 nms_ignorebots 1 nms_announce 1 } // ******************************* // * THE SCRIPT CODE STARTS HERE * // ******************************* block load { es_xset nms_spawntime 5.0 "Time from round start after which players cannot spawn" es_xset nms_ignorebots 1 "Set to 1 to allow bots joining in any point" es_xset nms_announce 1 "Nomidspawn script announcement level, min=0, max=3" es_xdoblock nomidspawn/config es_log "nomidspawn - No middle-round spawning - LOADED" es_xset _nms_allowspawn 1 "nomidspawn run-time variable" es_xset _nms_delaycount 0 "nomidspawn run-time variable" es_xset _nms_botcheck 0 "nomidspawn run-time variable" es_xset _nms_active 0 "nomidspawn run-time variable" } block unload { es_log "nomidspawn - No middle-round spawning - UNLOADED" } event round_end { es_xset _nms_allowspawn 1 es_xset _nms_active 0 } event es_map_start { es_xset _nms_allowspawn 1 es_xset _nms_delaycount 0 } event round_start { es_xset _nms_active 1 es_xmath _nms_delaycount + 1 es_delayed server_var(nms_spawntime) es_xdoblock nomidspawn/stopspawn ifx parse("nms_announce and 2") do { es_xmsg #multi #greenThis server is protected from late joiners spawning by#default nomidspawn } } event player_spawn { ifx false(_nms_allowspawn) do { if (event_var(es_userteam) > 1) do { es_isbot _nms_botcheck event_var(userid) ifx true(nms_ignorebots) do { ifx false(_nms_botcheck) do { es_xdoblock nomidspawn/nospawning } } else do { es_xdoblock nomidspawn/nospawning } } } } block stopspawn { es_xmath _nms_delaycount - 1 ifx true(_nms_active) do { ifx false(_nms_delaycount) do { es_xset _nms_allowspawn 0 } } } block nospawning { es_delayed .2 es_xsexec event_var(userid) kill ifx false(_nms_botcheck) do { ifx parse("nms_announce and 1") do { es_msg #multi #greenPlayer#default event_var(es_username)#green was slain for late-spawning } } }