Raised This Month: $ Target: $400
 0% 

easy request - Rank plugin edit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
morrow
Member
Join Date: Dec 2008
Old 10-19-2013 , 07:40   easy request - Rank plugin edit
Reply With Quote #1

Hello, i have a one rank plugin , but i dont know how to edit it, can somebody help me with that ?
I have rank system it shows frags and army rank status, like: general , major ...
But i need to everybody see that , when somebody write in chat something then he have before his name status [Major] Name : blablabala...
Thats first, and second request is if its possible: something like top 15 , but if somebody write /top then open "like motd" and shows top 10 best ranked people :

1. name rank: Marshal
2. name2 rank: General


Really really sorry for my bad English, i hope you understand me


PHP Code:
#include <amxmodx>  
#include <amxmisc>  
#include <csstats>  
#define HUD_INTERVAL 1.0  
#define RANK_NOTHING 0  
#define RANK_PRIVATE 1  
#define RANK_PRIVATE_FIRST_CLASS 2  
#define RANK_CORPORAL 3  
#define RANK_SERGEANT 4  
#define RANK_STAFF_SERGEANT 5  
#define RANK_GUNNERY_SERGEANT 6  
#define RANK_MASTER_SERGEANT 7  
#define RANK_COMMAND_SERGEANT 8  
#define RANK_SECOND_LIEUTENANT 9  
#define RANK_FIRST_LIEUTENANT 10  
#define RANK_COLONEL 11  
#define RANK_BRIGADIER_GENERAL 12  
#define RANK_MAJOR_GENERAL 13  
#define RANK_LIEUTENANT_GENERAL 14  
#define RANK_GENERAL 15  
#define RANK_GENERAL_OF_THE_ARMY 16  
#define MAXRANKS 17  
new PlayerRank[33]  
new const 
rankNames[MAXRANKS][] =  
{   
"None",   
"Private",   
"Private First Class",   
"Corporal",   
"Sergeant",   
"Staff Sergeant",   
"Gunnery Sergeant",   
"Master Sergeant",   
"Command Sergeant",   
"Second Lieutenant",   
"First Lieutenant",   
"Colonel",   
"Brigadier General",   
"Major General",   
"Lietenant General",   
"General",   
"General of the Army"  

 new const 
rankXP[MAXRANKS] =  
 {  
 
0100200400800,1000,2000,4000800010000120001500020000400005000080000100000  
 
}  
  
 public 
plugin_init()  
  
 { 
 
register_plugin("Rank Display""0.1","gaben")  
 }  
  
 public 
client_putinserver(id)  
 {  
 
set_task(HUD_INTERVAL"ShowHUD"id)      
 return 
PLUGIN_HANDLED  
 
}  
  
 public 
ShowHUD(id)      
 { 
      
 if(!
is_user_connected(id))        
 return 
0     
 
static stats[8], hits[8], name[33]   
 
get_user_stats(idstatshits
 
get_user_name(idname32
  
 new 
currentPlayerRank 0;   
 while 
 (
currentPlayerRank < (MAXRANKS 1))  
 {         
 if(
stats[0] >= rankXP[currentPlayerRank 1])          
 ++
currentPlayerRank;       
 else          
 break;   
 }        
 new 
leftkills stats[0]; 
 new 
right rankXP[currentPlayerRank 1
 
//I have no idea why you are storing the rank here, maybe you're planning to use it later    
 
PlayerRank[id] = currentPlayerRank;      
 
set_hudmessage(025500.01, -0.106.012.0
 
show_hudmessage(id"%s : %s^nFrags:[%i / %i]"namerankNames[currentPlayerRank], leftkillsright)     
 
set_task(HUD_INTERVAL"ShowHUD"id)     
 return 
PLUGIN_HANDLED 
 

morrow is offline
Reply



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 00:11.


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