Hi all! This is the first full plugin that I have made and a lot of the coding is bound to be redundant or buggy, so any suggestions or criticism is greatly appreciated.
DESCRIPTION
In short, Cops n Robbers is a game of stealth, reflexes, strategy and teamwork.
While this plugin is not thorough enough to be a full gameplay modification, it can be used as a minigame
or an occasional event in order to spice up your server.
The overall objective for either team is to kill all of the opposing team's players.
For CTs, this can be done simply by shooting the terrorists.
For Ts however, it is more difficult, as they only spawn with a knife.
Additionally, the CTs start with 500 hitpoints, where the Ts start with the standard 100.
The catch is that the Ts are invisible and cannot be seen by the CTs.
The Ts are able to obtain weapons and powerups through the shop included in this plugin (say /shop).
However, the only way for Ts to gain money is to commit crimes.
While committing a crime, the T becomes visible and the CTs are notified.
So the CTs patrol the map hunting for deviant Ts, trying to catch them in the act, while at all times checking
their back for sneaky pickpocketers (one of the criminal professions).
The Ts attempt to stealthfully avoid the CTs so that they can commit their crimes and build up their money
for an eventual assault on the CTs.
As an optional twist, an admin can change the cvar "cnr_fbimode" to 1 to change the game mode to "FBI".
This means that every round the CTs can select a random object to transform into in order to stake-out
the Ts and catch them in the act.
This can be used strategically, as the CTs each cover a different post looking like inconspicuous objects,
making it very difficult for the Ts to go about unnoticed.
It should be noted that while the game is in this mode, it may be more difficult for Ts under the professions
Pickpocketer and rapist as they have to stalk the CTs in order to commit their crimes.
It should also be noted that Ts are only invisible when weilding the knife and become visible when they attack a CT
with any weapon for a certain period of time (default 5 seconds).
The CTs also get a shop which is accessable by typing /ctshop (as opposed to simply /shop). This shop sells items
that assist in the apprehension and discovery of the sneaky criminals.
The CTs gain a certain amount of money (salary, 500 by default) every round, but also receive bonuses depending on
the damage they do to enemies.
Classes
Every round, a menu pops up for the terrorists, allowing them to choose a criminal profession.
As at version 1.0 (current), there are 3 professions to choose from:
1) Marijuana Grower - The criminal must find a hiding spot somewhere on the map and press E to begin planting marijuana. For a certain period of time (20 seconds by default) they are drastically slowed and visible. If they survive the full length of this time, they are given a large sum of money.
2) Pick-Pocketer - The criminal must stalk a CT and knife them in order to steal a small amount of money from that CT.
3) Rapist - The criminal must press E to activate the "rapist knife" and then stalk a CT, knifing them to rape them. While being raped, the CT cannot move or attack the rapist, but has godmode. The T is also immobilized, and can be attacked by any CT other than the one being raped. This process lasts a certain period of time (20 seconds by default) and after this time, the T gains a moderate sum of money and is visible for a certain period of time after the raping (5 seconds by default) so the CT can attempt to get his Revenge.
Shop Items
TERRORIST SHOP (say /shop)
GUNS
M4A1
Pump shotgun (M3)
Deagle
Awp
Para
OTHER
+100 hp
+100 ap
speed
silence (no footsteps)
COUNTER_TERRORIST SHOP (say /ctshop)
detector
Makes all Ts visible for a set amount of time (default 15 seconds)
SNIFFER CRAB
Spawns a headcrab that wanders around until it finds a T and then chases them. This is used to sniff out the general location of an invisible criminal as well as alert you when they are near. You can press E to teleport the headcrab to you so you can bring it with you.
RADAR
Pings all terrorists nearby on your radar every 2 seconds, giving the general location of a hiding or stalking criminal.
CVARS
---Gameplay---
cnr_fbimode", Determines whether or not FBI mode is enabled (Default = 0 [off])
cnr_startmoney", Sets the starting value of money for all players (Default = 500)
cnr_criminal_slash_only", Determines whether or not Ts are only able to "nubslash" (Default = 1 [on])
cnr_armed_criminal_time", Sets the time after an assault in which a T is visible (Default = 10.0)
cnr_pickpocket_amount", Sets the amount of money a successful pick-pocketer receives (Default = 50)
cnr_pickpocket_criminal_time", Sets the amount of time a successful pick-pocketer remains visible (Default = 5.0)
cnr_marijuana_time", Sets the amount of time it takes to finish planting marijuana (Default = 20.0)
cnr_marijuana_amount", Sets the monetary reward for planting marijuana (Default = 500)
cnr_rape_time", Sets the length of time it takes to "rape" a person (Default = 20.0)
cnr_rape_amount", Sets the monetary reward for "raping" a person (Default = 350)
cnr_rape_delay, Sets the length of time following the rape before the rapist is able to activate their "rapist knife" again (Default = 5.0)
cnr_rape_criminal_time, Sets the length of time following the rape before the rapist becomes invisible (Default = 5.0)
cnr_assault_criminal_time, Sets the length of time following a regular assault (attack on any CT using any weapon) before the T regains invisibility (Default = 5.0)
cnr_ct_salary, Sets the amount of money a CT gains each round (Default = 500)
cnr_ct_damage_multiplier, Sets the number that is multiplied to the damage done on an enemy, resulting in a cash bonus (Default = 2.0)
For example, if cnr_ct_damage_multiplier is set to 2, if a CT shoots a T, doing 50 damage, he receives (2*50 = 100) money as a bonus
cnr_marijuana_sound, Determines whether or not to play a sound every 2 seconds when a player is planting marijuana (Default = 1[on])
---Shops---
cnr_m4a1cost, Sets the cost of the M4A1 in the terrorist shop (Default = 3500)
cnr_pumpcost, Sets the cost of the pump shotgun in the terrorist shop (Default = 3000)
cnr_deaglecost, Sets the cost of the deagle in the terrorist shop (Default = 2500)
cnr_awpcost, Sets the cost of the awp in the terrorist shop (Default = 5000)
cnr_paracost, Sets the cost of the para in the terrorist shop (Default = 5000)
cnr_hpcost, Sets the cost of +100 hp in the terrorist shop (Default = 1500)
cnr_apcost, Sets the cost of +100 ap in the terrorist shop (Default = 1000)
cnr_speedcost, Sets the cost of additional speed in the terrorist shop (Default = 2000)
cnr_speed_amount, Sets the level of additional speed from the terrorist shop (Default = 300.0)
cnr_silencecost, Sets the cost of silent footsteps in the terrorist shop (Default = 3500)
cnr_detectorcost, Sets the cost of detector from the counter-terrorist shop (Default = 3000)
cnr_detectortime, Sets the time that the detector lasts (Default = 15.0)
cnr_crabcost, Sets the cost of the sniffer crab in the counter-terrorist shop (Default = 1500)
cnr_radarcost, Sets the cost of the radar in the counter-terrorist shop (Default = 2500)
cnr_radarsound, Determines whether or not to play a sound after each 2 second ping of the radar (Default = 1 [on])
CREDITS
General Credits
GHW_Chronic for his headcrab AI plugin, and chr_engine and headcrab includes
I used these in adding the sniffer crab to this plugin
apuu for his hns transformers plugin
I used the models from that plugin for the FBI mode of this plugin
SonicSonedit for his ZP extra item - radar plugin
I took the radar from that plugin and added it to the CT shop for this
Inspiration and Ideas
Necro for his blockmaker plugin
I learned a lot of my coding knowledge from this plugin and so this plugin is heavily influenced by it
Al3x for his optimisation of necro's blockmaker plugin
I also learned a few techniques from this
Exolent for his hide'n'seek plugin
I also learned a lot of my coding knowledge from this plugin and so this plugin is heavily influenced by it as well
MODULES REQUIRED
Fakemeta
Fun
Cstrike
Engine
Hamsandwich
CHANGELOG
V1.0 - Created, minimal testing.
V1.1 - Added marijuana sound cvar, incorporated stocks from additional includes into code, slight code improvement. Minimal testing.
NOTES
This plugin requires GHW_Chronic's
headcrab AI plugin in order for it to work.
This plugin uses stocks from the following includes: colorchat.inc, headcrab.inc, chr_engine.inc. The functions from those includes are not mine and credits for their creators are mentioned above.