Raised This Month: $ Target: $400
 0% 

Subplugin Submission [ZP 5.0][2.1.2] Addon: Military Rank System


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 07-24-2011 , 08:25   [ZP 5.0][2.1.2] Addon: Military Rank System
Reply With Quote #1

Description:
This adds a rank system, similar to Military Rank. EXP are gained by killing zombies/assisting the killer by hitting certain amount of damage.

Main features:
  • Uses Zombie Plague 5.0 now!
  • Assist EXP
  • Rank on top of their head when aimed from a certain distance
    (NOTE: Zombies will not be able to see the rank to make mp_playerid works with this)
  • Rank name will be shown on chat when you type something out.
  • Multi-leveling

CVars:
  • zp_rank_xp - Amount of EXP gain from killing a zombie without headshot
  • zp_rank_hsxp - Amount of EXP gain from killing a zombie with headshot
  • zp_rank_assistxp - Amount of EXP gain from assisting a non-zombie killer
  • zp_rank_assisthpdivide - Amount of damage [Zombie Maxhealth / CVAR] needed to get an assist.
  • zp_rank_icon - Enable/Disable rank icon.
  • zp_rank_icon_time - Random lulz. Codes from BF 2 Rank Mod.

Commands:
  • /showrank

Requirements:
  • STEAM!
  • AMXModX
  • FakeMeta
  • nVault
    - You only need nVault if you are using nVault to save data
  • SQLx
    - You only need SQLx if you are using SQLx to save data
  • SQLVault
    - You only need SQLVault if you are using SQL to save data
  • Zombie Plague

Changelogs
  • 1.0 - Initial release
  • 1.1 - New CVar - zp_rank_icon, enable or disable rank icon.
  • 1.2 - Added a new check and remove useless check on hook_say/team
  • 1.3 - Changed event_DeathMsg & hook_say/team
  • 2.0 - Conversion to 5.0 & hamsandwich removed
  • 2.0.1 - Fixed 2 natives not working (Wrong function name, my bad)
  • 2.0.2 - Fixed first round CVars not cached
  • 2.0.3 - Added addition check to prevent such random crash
  • 2.0.4 - Fixed chat doesn't work
  • 2.1.0 - Optimized code(get_maxplayers --> get_players).
    - Changed client_printcolor to zp_colored_print. Removed SQL defines in nVault's.
    - Fixed chat message bug.
    - Added check for valid entity before displaying rank icon.
    - Changed SQL's "#define" to "new"
    - Changed XP to EXP.
  • 2.1.1 - Typo error in the table causing error when saving.
  • 2.1.2 - Optimization on SQLx
    - nVault has a new saving method! Tested and working.
    - Changed /rank to /showrank since /rank is already used for AMXX.
    - No more natives. It's buggy and not working.

Rank names and EXP
Note: They are all based on US Marine ranks.

PHP Code:
new const RANKS[][]=
{
    
"Private"// 0
    
"Private 1st Class"// 1
    
"Corporal"// 2
    
"Sergeant"// 3
    
"Staff Sergeant"// 4
    
"Sergeant 1st Class"// 5
    
"Master Sergeant"// 6
    
"Sergeant Major"// 7
    
"2nd Lieutenant"// 8
    
"1st Lieutenant"// 9
    
"Captain"// 10
    
"Major"// 11
    
"Lieutenant Colonel"// 12
    
"Colonel"// 13
    
"Brigadier General"// 14
    
"Major General"// 15
    
"Lieutenant General"// 16
    
"General"// 17
    
"General of the Army" // 18
}

new const 
EXP[] =
{
    
0// 0
    
50// 1
    
100// 2
    
200// 3
    
400// 4
    
800// 5
    
1600// 6
    
3200// 7
    
6400// 8
    
12800// 9
    
25600// 10
    
51200// 11
    
102400// 12
    
204800// 13
    
409600// 14
    
819200// 15
    
1638400// 16
    
3276800// 17
    
6553600 // 18

Modify this to your specified SQL settings
PHP Code:
new SQL_HOST[] = "127.0.0.1"
new SQL_USER[] = "root"
new SQL_PASS[] = "yoursqlpasswordhere"
new SQL_DB[] = "amx" 
Notes:
  • There's no crash-proof nVault or any other module(SQLx or such), so if your server crashes and corrupted the vault. Don't blame it on the plugin. Blame it on the server itself.

Credits:
  • BF2 Rank Mod
  • Kill Assist
  • nikhilgupta345 & bibu
Attached Files
File Type: zip sprites.zip (14.0 KB, 2576 views)
File Type: sma Get Plugin or Get Source (zp50_rank_nvault.sma - 4065 views - 11.8 KB)
File Type: sma Get Plugin or Get Source (zp50_rank_sqlvault.sma - 2993 views - 11.8 KB)
File Type: sma Get Plugin or Get Source (zp50_rank_sqlx.sma - 2633 views - 13.2 KB)

Last edited by Excalibur.007; 12-09-2011 at 03:33.
Excalibur.007 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode