Playing on a lot of race maps of different kinds (race, sliderace, xc, mg maps, etc...), I noticed that a lot of them were just "missing" a reward for the first player reaching the goal.
I think it's a pity because a lot of these old maps are great and would deserve to be played on more servers.
So I had the idea to create a plugin which would allow admins to:
- draw defined zones in any map
- reward a player who reaches the zone
- execute a file as soon as a zone is reached (to allow many more outputs than just a normal reward.)
I took the code of Peace-Maker's Anti Rush plugin to create and manage zones, and Andi67's sm_skinchooser plugin sourcecode for the skin reward stuff.
Big thanks to them for making their respective plugins (and allowing me to use them).
Installation:
Default:
Just download the complete_pack(all_in_one).zip and extract it to your server's cstrike folder. It's a ready-to-play pack.
The sound file used when a zone is reached is included, but the command used (sm_play) can be used with any default sound of the game. Unlike custom sounds, game sounds do not need to be downloaded, which is pretty cool.
The list can be found in sound/music using GCFScape.
Custom:
Spoiler
Drop sm_zones_cmds.smx in your addons/sourcemod/plugins folder.
Drop sm_zones_cmds.sp in your addons/sourcemod/scripting folder.
Drop sm_zones_cmds.phrases.txt in your addons/sourcemod/translations folder.
Drop zones_commands.cfg and zones_newround.cfg in your cfg/sourcemod folder, or rename them according to sm_zones_cmds_config_file and sm_zones_cmds_newround_file values.
Create a sm_zones_cmds folder in your addons/sourcemod/configs folder.
(It will be used when creating/reading mapzones.)
Drop the 3 ini files in your addons/sourcemod/configs folder.
->Fill sm_zones_cmds_skin_t.ini with a valid model name that will be used if the winner is a Terro.
->Fill sm_zones_cmds_skin_ct.ini with a valid CT model.
->List all files regarding skins in sm_zones_cmds_skins_downloads.ini.
I attached ini files as an example so you can see how they should look like.
The attached example_models_pack will work with provided ini files. In the complete pack, I included a sound, and I also gave a few map zones config files so that you can start playing and test it straight away.
cvars:
Code:
sm_zones_cmds_enabled - Enable/Disable zones detections (default: 1).
sm_zones_cmds_postaction - How should the plugin behave when a player reaches a zone. 1: Announce in chat, 2: Announce, reward, execute config file, 3: Slay (default: 2).
sm_zones_cmds_fencecolor - Which color should the fences have? RGBA: red green blue alpha (default: 255 0 0 255).
sm_zones_cmds_showzones - Show created zones? (default: 0)
sm_zones_cmds_newround - Enable/Disable config file executed at roundstart, regardless of sm_zones_cmds_enabled (can be useful as a stand alone function) (default: 0).
sm_zones_cmds_fragreward - Enable/Disable frag reward (50 frags) (default: 1).
sm_zones_cmds_cash - Enable/Disable cash reward ($16000) (default: 1).
sm_zones_cmds_skin_enabled - Enable/Disable skin reward (default: 1).
sm_zones_cmds_skin_timer - Enable/Disable timer before a skin is applied at spawn (to override other plugins) (default: 0).
sm_zones_cmds_config_file - File to be executed when a zone is reached, located in cfg/sourcemod folder (default: zones_commands.cfg).
sm_zones_cmds_newround_file - File to be executed at roundstart, located in cfg/sourcemod folder (default: zones_newround.cfg).
Admin command: sm_zones_cmds_menu: Opens the zones edit menu.
How to use
Spoiler
-> I use this plugin on sliderace maps where I enable auto respawn. Thus, I set mp_ignore_round_win_conditions to 1 at roundstart (otherwise the last racing player can't continue its race and the round restarts).
When a player finishes the map, a sound is played, and he/she gets cash, 50 points, and is also rewarded with a server side skin. At that point, I deactivate the respawn and set mp_ignore_round_win_conditions back to 0 to allow the round to end (and the map to finish if timelimit is reached).
Plus, some traps in the map certainly need to be restarted, so it's nice to let the round end sometimes.
My advice: You can event make a 'loop' with the config files so that a different sound is played at roundstart, like so:
For certain maps, I set sm_zones_cmds_newround_file to a file named "zones_newround_goodold1.cfg"
This file plays a new sound at round start and defines the next sm_zones_cmds_newround_file. When a player hits the zone, round end is possible thanks to the zones_commands file:
Please note that there are several respawn plugins on this site, just pick the one you like and set your cvars accordingly.
This plugin can be used/edited freely and I even encourage you to do so to fit your needs. There are a lot of stuff that could be added like making vehicles spawn or changing players glow/color/alpha or many other things.
For now, when a player reaches a zone, the zone output is disabled (like there can only be one winner for a zone, it was meant to be used on race maps...) but it could easily be modified if needed.
All comments are, as usual, welcome.
St00ne
Change log:
v1.4b: 1st public release.
v1.4c: Fixed a 'Native GetClientTeam error' and more zones added in the complete pack.
v1.4d: Removed FCVAR_REPLICATED flag on version cvar.
v1.4e: Rewrote Timer_Spawn part using GetClientSerial.
Thanks, but to be honest I don't understand the purpose of this plugin
Haha, I'm surprised you asked for a pack then... anyway I had to add one.
The purpose of the plugin is explained in the description, and takes all it sense when you load old sliderace maps like sliderace_city or re_sliderace_v2_b4.
We can also configure this plugin to slay everyone who is in zone?
Yep
Quote:
sm_zones_cmds_postaction - How should the plugin behave when a player reaches a zone. 1: Announce in chat, 2: Announce, reward, execute config file, 3: Slay (default: 2)
So basically you can event put zones which give rewards, and zones which slay, in the same map.
Useful for some maps like re_sliderace_v2_b4 which "misses" a zone to kill/respawn at the end.
Mapzones for this map are included in the full pack.