Battlefield 2: Rank Mod by pRED*
.: Description :.
This plugin is an attempt to recreate the Battlefield ranking system onto CS1.6.
Features the basics of the ranking system, with no power up gain received from leveling. Power ups are an optional feature gained by obtaining Badge Awards. Badges are obtained by completing specified tasks. This plugin utilizes AMX Mod X's stats system.
Ranks are based on the number of Points you have. Points are earned from frags and from planting/defusing the bomb. Also, if you choose to run it Points can be earned from the objectives of the CS Flags plugin.Other Info:
NOTE: Some Ranks require Badges to be gained just like in BF2, so if you choose to disable Badges by the bf2_badges cvar those Ranks are not obtainable.
Badges are earned by accomplishing the objectives specified in the help menu. For example, the Basic Knife Badge is earned by 2 knife kills in 1 spawn. There are 3 levels of Badges in increasing difficulty just like in BF2: Basic, Veteran, and Expert. If enabled, Badges will give the power up bonuses listed below.
Badge - Basic/Veteran/Expert Reward (*optional feature)Players with one thirds, two thirds, or all of the Badges will get 50, 100, and 200 Armor(Vest+Helm) respectively.
Knife - 20/40/60% of damage done with knife returned to player.
Support - +2/+4/+6 M249 damage per bullet
Pistol - 20/25/33% chance of stunning attacker
Assault - +10/+20/+30 Bonus HP when spawning
Sniper - 1/3,1/2,1/1 Chance of Free awp/scout
Explosives - .2/.4/.6 multiplier added to Grenade damage
Shotgun - 150/100/50 alpha level invisibility with Knife
SMG - 15/30/45 speed boost added for all weapons
Medals are awarded for getting 1st, 2nd, and 3rd highest frags at the end of the map. These do not award any powerups but keep track of the highest number of wins on the server stats page (see the ingame menu)
Servers running the mod
Plugin usage stats
(these need to be updated)
Rank Icon Being Displayed
Free Items when you spawn
Pistol Badge Imobilising an enemy
Another Rank Icon Being Displayed
Running out of ideas... Hmm another rank icon!
.: Complimentary Addons :.
.: Requirements :.
.: Known Issues :.
- Amx Mod X 1.80 or above w/Counter-Strike Addon
nVault or MySQL (depending on save method)
- Sprites in "BF2 Rank Mod 1.5.5.zip"
1. In order to obtain some Ranks, Badges must be turned on.
2. If the server has bots, csstats_rankbots must be set to 1 in order for bots kills to count toward Badges.
3. Plugin will not load without the required sprites.
4. Round must end normally for medals to be given (dependent on intermission event, changelevel and amx_map will not call this event).
.: Installation :.
bf2webdocs.zip - Optional motd web pages for help info, requires website to host if used.
bf2rank.sma - sma script, not complete plugin. Attached only for reference purposes.
BF2 Rank Mod 1.5.5.zip - For new installs. Contains entire script, compiled plugin, required sprite files, and optional sounds.
BF2 Rank Mod 1.5.5 script only.zip - For upgrading servers, contains script only. Needs to be compiled.
New Installs (nVault saving):
- Unzip all files in "BF2 Rank Mod 1.5.5.zip" to your server's mod directory (the "cstrike" or "czero" folder).
- Add bf2rank.amxx to your plugins.ini file (".../amxmodx/configs/plugins.ini")
- Copy and paste the cvars shown below into amxx.cfg
- (optional) Unzip "bf2webdocs.zip" onto a web host and set bf2_help_url "" to the url location of the webdocs
- (optional) Delete or add optional sound files in "BF2 Rank Mod 1.5.5.zip" to ".../sound/bf2rank/"
If upgrading just download "BF2 Rank Mod 1.5.5 script only.zip" extract contents and compile locally. Then just upload the newly compiled file to your server. This last update included 2 optional sound files, if not on your server they will not be used.
For MySQL saving a define must be uncommented at the top of bf2rank.sma and script must be recompiled.
Note: there is no way to transfer nVault saved data to MySQL or vise versa and I have no plans to add that function.
.: Compile Settings :.
.: Commands :.
// Uncomment to use MySQL instead of the default nVault saving
// Admin flag settings for giving points/badges and server saved data reset
// These can also be set in cmdaccess.ini without need to change here
// (See amxconst.inc for more admin level constants)
#define ADMIN_LEVEL ADMIN_BAN
#define ADMIN_RESET ADMIN_RCON
// Note: Changing any of the above the above requires plugin to be recompiled
bf2_resetstats - Resets all of your stats
bf2_addbadge <player> <badge> <level> - Gives a badge to player. Requires Ban admin access. Badge <0-7>. Level <0-3>
bf2_addkills <player> <kills> - Adds to a players kills.. Also requires ban access
"/bf2menu" - Shows the Main Menu
.: Cvars :.
"/who" - Shows a list of player and their rank
"/whois <name>" - Show the rank and badges of a specific player
"/whostats <name>" - Show the stats page for a player
"/ranks" - Shows the kill xp table
"/help" - Displays a Help MOTD
"/badges1" - Displays a Help MOTD on some of the badges
"/badges2" - Displays a Help MOTD on the rest of the badges
"/badges3" - Badges 3
"/bf2stats" - Show a list of your kill data
Copy and paste to amxx.cfg
.: Changelog :.
//////////////////////// Battlefield 2: Rank Mod ////////////////////////
bf2_active 1 //(1|0) - Turns the plugin on or off - Default 1
bf2_badges 1 //(1|0) - Turns the badge system on or off - Default 1
bf2_badgepowers 0 //(1|0) - Enable/Disable the powers for the badges - Default 0
bf2_awp 0 //(1|0) - Is user given an awp or scout by having the sniper badge - Default 0 (scout)
bf2_ffa 0 //(1|0) - Enable/Disable team attack for receiving pts and for badge use, turn on for "free for all" servers - Default 0
bf2_xpmultiplier 0.1 //(float) - Changes the point multiplier needed to reach each level - Default 0.1 (15 points for rank 1, 20k points for top rank)
bf2_xpminplayers 2 //(int) - Minimum number of plays required to be in server before bonus bomb and flag xp (only) is awarded
bf2_reset_days 21 //(int) - Number of days without playing till xp gets pruned per user (Note: currently nvault saving only)
bf2_icon_time 1.5 //(float) - Amount of time to display the rank icons for. Default 1.5, 0 to disable icons all together.
bf2_help_url "" //(string) - Remote folder where the bf2 web docs are stored (optional) do not include the trailing /
bf2_statustext 1 //(int) - Enable/Disable the points, # of bagdges, and rank info that replaces player name info in hud - Default 1
bf2_hud_options "abcde" //(flags) - Set options for player aim hud message info (not shown if miscstats PlayerName option is on) - Default "abcde"
//flag a - Display Health/Armor/Weapon for teammates
//flag b - Display Rank for teammates
//flag c - Display Rank for enemies
//flag d - Hide display for invisible enemies
//flag e - Move the display to above peoples heads
//CS Flags integration
bf2_flag_kills 2 //(int) - CS Flags - How many bf2 points are awarded for capturing a flag
bf2_flag_round_kills 0 //(int) - CS Flags - How many bf2 points are awarded for winning a round
bf2_flag_match_kills 0 //(int) - CS Flags - How many bf2 points are awarded for winning the match
.: Credits :.
1.5.5 - 4/21/11
Fixed Assult Badge health bonus to only give health if less than current health to avoid conflicts.
Fixed max armor bonus to only give armor if less than current armor to avoid conflicts.
1.5.4 - 4/18/11
Changed data to load instantly instead of on tasks in plugin_cfg due to possible bug with bots.
Skipped nVault pruning if bf2_reset_days is set to 0.
Fixed bf2_resetserverstats to clear server bf2 stats and SQL's bf2ranks2 table data.
Changed Lieutenant General and General to be obtainable when badges are turned off.
1.5.3 - 6/8/10
Fixed bf2_hud_options to allow disabling player aim hud message info by setting cvar to nothing "".
1.5.2 - 8/31/09
Changed bf2_flag_min_players to bf2_xpminplayers and made it include bomb xp
Added bf2_statustext cvar to allow disabling replacement of hud name info, may also be used by other mods
Changed bf2_badgepowers cvar to be off by default.
Changed bf2_hud_options cvar to include e by default, the comments said it was included but was not.
Small updates to information in help motd's and other motd edits.
Fixed speed check to run on spawn and round start.
1.5.1 - 4/18/09
Fixed bf2_resetserverstats command to use ADMIN_RESET instead of ADMIN_LEVEL define
Fixed pistol badge code from being run on self from a suicide
Removed useless /hud command
1.5 - 4/15/09
Added saving by IP and nick controlled by csstats_rank cvar
Added saving for bots controlled by csstats_rankbots cvar
Added bf2_ffa cvar to enable/disable team kills to count for points
Added use of Hamsandwich for spawn and damage change code
Added check for PlayerName miscstats option to disable BF2's hud info
Added 2 Optional sounds from BF2 for rank and badge gain
Fixed speed system and added calls for FOV speed changes
Fixed badge checking not being checked on death not from a player
Updated SQL saving code for improvements
Removed CSDM define and bf2_csdm.inl as changes made them unnecessary now
Removed fakemeta_util_mini.inl and included fakemeta_util.inc
Removed excess calls of DisplayHUD and save_badges
Fixed variable length that hold player names
Fixed a few possible out of bounds strings, still need to fix rest
Changed default ADMIN_RESET define to ADMIN_RCON from ADMIN_CFG
Fixed knife badge max hp and to only show blue glow/screenflash if hp is given
1.4.1 - 2/27/09
vittu takes over maintaining the plugin due to pRED moving to SourceMod
Fixed CS Flags compatibility
Fixed TK giving points, will set an option to enable later
Fixed self grenade kill from adding to grenade kills
Fixed missing Lt General rank issue
Fixed description of requirements for special and higher ranks
Updated rank requirements not updated when more badges were last added
Adjusted StatusText, points hud info, to better fit max character amount
Added band-aid fix for auto save by steamid or IP, will update method later
Fixed wrong sprites displaying
fixed double hp gain on round reset (CSDM)
added /whostats command
bf2_help_url (and web motds) and bf2_badgepowers cvars
CSDM badges not being awarded.
Top ranked in server display message
Reset your stats command
Medals other new stats
Logging admin commands
Two new badges. Fixed Explosives badge for csdm
Heaps of new stats options + saving them (server and player)
Changed power for support
SQL now a defined option
Moved needed fakemeta_util functions into a separate file (included)
New HUD system thanks to vittu (added cvar to control it)
bf2_reset_days cvar - number of days without playing till xp gets reset
Lowered chance of imobilising happening.
Changed damage event and bomb events to the csx forward versions and created a csx forward include
Capped knife badge damage to 130
Removed bf2_vaultload (pointless now.)
Fixed some spelling newbie mistakes..
Fixed immunity problems
Moved inl and config files into their own folder..
Probably a few other things too..
Starting work on 4 New ranks
Shows Teammates rank when you look at them.
Give 50,100,200 armour for having 6,12 or 18 badges..
Bf2 now saves totalkills itself. Prevents csstats resets..
bf2_addkills (admin abuse tool? - or to reset after csstats reset), gives x kills to a player
Reduced the amount of saving to vault - causing server lag.
Changed to nVault saving. Now uses only 1 vault data instead of 14.
Fixed armour being lower than you had before
Split file into large set of includes. Way easier to find functions you want.
Added +3 kills for defuse/explode. Cs flags mod support.
Added cvar bf2_version to allow the plugin to be detected by game monitor. (don't edit this.. it's just for info)
Fixed the html files after word pwnt them. I <3 microsoft.
Added CSDM functionality. Give hp/weapons on all spawns.
Recoded badge checking to be individual on player death
Fixed HP bug and added message "beginning badge check"
bf2_addbadge admin command added
Added a badge check 5 seconds before map changes.
Massive change to make global kill counting actually work..
Added screen to view weapon stats "say /bf2stats" or use the menu
Added concmd "bf2_vaultload" to forcibly load your own data from the vault (im using it to convert my stats from vault to sql)
Tell people to type bf2_vaultload into console and their badges will be restored. Other than that probably a useless command
Fixed Bug with Veteran Assault badge
Added SQL support (bf2_sql 1)
Changed support badge to bonus speed (added code for extra damage, recoil - will finish when amxx 1.77 is released)
Sounds, Screen Shake, User glows..
Read the SMA.. The list is getting kinda big. Thanks to all of you.
Do not attempt to use the "Get Plugin" link
The attached sma contains only a tiny amount of the code and is just there for reference purposes. (especially checking the credits section)