Raised This Month: $32 Target: $400
 8% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
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, 2560 views)
File Type: sma Get Plugin or Get Source (zp50_rank_nvault.sma - 4041 views - 11.8 KB)
File Type: sma Get Plugin or Get Source (zp50_rank_sqlvault.sma - 2963 views - 11.8 KB)
File Type: sma Get Plugin or Get Source (zp50_rank_sqlx.sma - 2612 views - 13.2 KB)

Last edited by Excalibur.007; 12-09-2011 at 03:33.
Excalibur.007 is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 07-24-2011 , 08:27   Re: [ZP][SQL] Addon: Basic Rank System
Reply With Quote #2

Solution for some errors:

If you get this error
PHP Code:
L 12/03/2011 12:19:43: [AMXXDisplaying debug trace (plugin "zp50_addon_rank_sqlx.amxx")
L 12/03/2011 12:19:43: [AMXXRun time error 11divide
L 12
/03/2011 12:19:43: [AMXX] [0zp50_addon_rank_sqlx.sma::event_DeathMsg (line 448
Error solution

Last edited by Excalibur.007; 12-03-2011 at 05:28.
Excalibur.007 is offline
klatro
Senior Member
Join Date: Oct 2009
Location: The world and at home
Old 07-25-2011 , 03:25   Re: [ZP][SQL] Addon: Basic Rank System
Reply With Quote #3

Thank you very much for this plugin.

Good job! )
klatro is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 07-25-2011 , 03:53   Re: [ZP][SQL] Addon: Basic Rank System
Reply With Quote #4

Quote:
Originally Posted by klatro View Post
Thank you very much for this plugin.

Good job! )
I assume it works as expected.
Excalibur.007 is offline
Nick Haldem
Senior Member
Join Date: Jun 2011
Location: Moldova
Old 07-29-2011 , 02:50   Re: [ZP][SQL] Addon: Military Rank System
Reply With Quote #5

What humans gain by new rank name??
__________________
Your server is empty? Visit our webpage http://boost.dyc.lv/ and make it full!!!
Nick Haldem is offline
Send a message via Skype™ to Nick Haldem
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 07-29-2011 , 03:07   Re: [ZP][SQL] Addon: Military Rank System
Reply With Quote #6

Is this icon looks like BF2 mod icon? icon damn ugly.
Code:
zp_rank_icon_time - Random lulz. Codes from BF 2 Rank Mod.
Can you make a cvar to completely turn off show icon on player head.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 07-29-2011 , 09:09   Re: [ZP][SQL] Addon: Military Rank System
Reply With Quote #7

Quote:
Originally Posted by yokomo View Post
Is this icon looks like BF2 mod icon? icon damn ugly.
Code:
zp_rank_icon_time - Random lulz. Codes from BF 2 Rank Mod.
Can you make a cvar to completely turn off show icon on player head.
Done. zp_rank_icon. 1 - Enable rank sprite, 0 - Disable rank sprite. Yeah it's more nicer when the sprite is on the original size, too bad we can't change the size of it with the message.

and these ranks aren't from BF2. I just took some random FPS games and crop it, make it 8x8 divisible and 256-bit Bitmap.

Last edited by Excalibur.007; 07-29-2011 at 09:18.
Excalibur.007 is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 07-29-2011 , 11:11   Re: [ZP][SQL] Addon: Military Rank System 1.1
Reply With Quote #8

Like my new rank system on Evil-Night.
Nice!
.Dare Devil. is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 07-29-2011 , 18:52   Re: [ZP][SQL] Addon: Military Rank System 1.1
Reply With Quote #9

Thanks.

If you know scripting, it'd do much more things for this. You can see that there are many natives for scripters to work on something. Like a perk system. Just like Call of Duty. Rank up for new perk. Lol.

Quote:
Originally Posted by Nick Haldem View Post
What humans gain by new rank name??
Sorry, did not see your post. And yes. Just a new rank name. This plugin is just to make your server look more military alike or just more cool if you are not a scripter. But I did this for scripters. Reason is on above. Just right before I quoted your message.

Most of my friends like it before it was public hehe.

Last edited by Excalibur.007; 07-29-2011 at 18:58.
Excalibur.007 is offline
MustD1e
Senior Member
Join Date: Apr 2010
Old 07-30-2011 , 06:53   Re: [ZP][SQL] Addon: Military Rank System 1.1
Reply With Quote #10

What about zombie? When player plays for zombie what his rank? Suggestion (if it possible), equate human player rank and zombie player rank (ex. private = stupid zombie + new sprite) and summary table will look like: Player1 Rank: Private/Stupid Zombie Exp: 0. Infect or kill zm_rank_xp_infect or zm_rank_xp_kill.
__________________

Fly with us

Last edited by MustD1e; 07-30-2011 at 06:58.
MustD1e is offline
Old 07-30-2011, 19:22
Excalibur.007
This message has been deleted by Excalibur.007. Reason: Stupid post :X
Reply


Thread Tools
Display Modes

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 12:30.


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