Raised This Month: $12 Target: $400
 3% 

[DM] Frags, HS, Rank


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff       
Malli Bojan
Junior Member
Join Date: Apr 2014
Old 03-16-2015 , 17:43   [DM] Frags, HS, Rank
Reply With Quote #1

[DM] Frags, HS, Rank

v1.1
by Malli Bojan



DeathMatch plugin that shows:

FRAGS
HEADSHOTS
RANK


Code:
v1.1 - Score Hud
In the middle of the screen shows SCORE

[CT] Team || || [T] Team



[CVARS]

*** COLOR ***

hud_red 0 // By defaultu 0
hud_green 255 // By defaultu 255
hud_blue 0 // By defaultu 0

*** POSITION ***

hud_x 0.02 // By defaultu 0.02
hud_y -1.0 // By defaultu -1.0

PHP Code:
#include                    <   amxmodx   > 
#include                    <   csstats   > 
#include                    < dhudmessage > 

#define IME              "[DM] Frags, HS, Rank" 
#define VERZIJA                  "1.1" 
#define AUTOR              "Malli Bojan" 

new                                g_MsgSync
new                            
g_iMsgScreenFade
new                           
FRAGS[33], HS[33]; 
new                        
CT_SCORETERRORIST_SCORE;  
new              
cvar_redcvar_greencvar_bluecvar_xcvar_y

public 
plugin_init( )
{
    
register_plugin         IMEVERZIJAAUTOR );
    
    
register_event      "DeathMsg""fw_PlayerDeath""a" );
    
register_event      "TeamScore""skor""a" ); 
    
register_event      "DeathMsg""EventDeath""a""1>0""3=1" );
    
    
g_MsgSync =                CreateHudSyncObj ( );
    
    
g_iMsgScreenFade =       get_user_msgid"ScreenFade" );
    
    
cvar_red =          register_cvar "hud_red""0" );
    
cvar_green =           register_cvar "hud_green""255" );
    
cvar_blue =            register_cvar "hud_blue""255" );
    
cvar_x =          register_cvar "hud_x""0.02" );
    
cvar_y =          register_cvar "hud_y""-1.0" );    
}

public 
client_connect id )
{
    
FRAGS[id] = 0;
    
HS[id] = 0;
    
    
set_task 1.0"fw_ShowHud"id__"b" );
}

public 
skor() 

    new 
team[32]; 
    
read_data(1,team,31); 
    if (
equal(team,"CT")) 
    { 
        
CT_SCORE read_data(2); 
    } 
    else if (
equal(team,"TERRORIST")) 
    { 
        
TERRORIST_SCORE read_data(2); 
    } 


public 
fw_PlayerDeath ()
{
    new 
killer read_data(1);
    new 
victim read_data(2);
    new 
headshot read_data(3);
    
    if ( 
killer == victim || get_user_team killer ) == get_user_team victim ) )
        return 
PLUGIN_HANDLED;
    
    if ( 
headshot 
    { 
    
HS[killer]++

    
FRAGS[killer]++
    
    
FRAGS[victim] = 0;
    
HS[victim] = 0;
    
    return 
PLUGIN_HANDLED;
}

public 
fw_ShowHud id )
{
    new 
stats[8], bodyhits[8];
    new 
RANK get_user_stats idstatsbodyhits );
    
    
set_hudmessage get_pcvar_num cvar_red ), get_pcvar_num cvar_green ), get_pcvar_num cvar_blue ), get_pcvar_float cvar_x ), get_pcvar_float cvar_y ) );
    
ShowSyncHudMsg(idg_MsgSync"%i KILL ( %i HS )^nRank: %i/%i"FRAGS[id], HS[id], RANKget_statsnum ( ) );
    
    
set_dhudmessage(070200, -1.00.0300.52.00.082.0true)
    
show_dhudmessage 0,"[CT] Team %d     |  |"CT_SCORE ); 
     
    
set_dhudmessage(20000, -1.00.0300.52.00.082.0true)
    
show_dhudmessage 0,"                                          |  |     %d [T] Team"TERRORIST_SCORE ); 
}  

public 
EventDeath( )
{
    
message_beginMSG_ONE_UNRELIABLEg_iMsgScreenFade_read_data) );
    
write_short<< 10 );
    
write_short<< 10 );
    
write_short0x0000 );
    
write_byte);
    
write_byte);
    
write_byte255 );
    
write_byte255 );
    
message_end( );

VERSION / BUGS

Code:
v1.1
* - Inserted SCORE SCREEN HUD and FADE
-------------------------------------------------- -----
Changed the hud way.
Inserted DHUD MESSAGE to Score Hud
Attached Files
File Type: sma Get Plugin or Get Source (DM_Frags_HS_Rank.sma - 867 views - 3.1 KB)

Last edited by Malli Bojan; 03-17-2015 at 16:28. Reason: v1.1
Malli Bojan is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 03-17-2015 , 13:00   Re: [DM] Frags, HS, Rank
Reply With Quote #2

Too many similar plugins have been made like this already.
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-17-2015 , 13:32   Re: [DM] Frags, HS, Rank
Reply With Quote #3

Quote:
Originally Posted by joshknifer View Post
Too many similar plugins have been made like this already.
+

1. Your coding style is horrible, too many spaces.
2. new FRAGS[32], HS[32]; it should be 33.
3.

PHP Code:
  if ( headshot )
    {
        
HS[killer]++;
        
FRAGS[killer]++;
    }
    else
    {
        
FRAGS[killer]++;
    } 
You can short it to:
PHP Code:
  if ( headshot )
    {
        
HS[killer]++;
}
FRAGS[killer]++; 
4. In fw_ShowHud vars should be static.
__________________
HamletEagle is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-17-2015 , 14:25   Re: [DM] Frags, HS, Rank
Reply With Quote #4

Very redundant, too simple, and it looks like you are beginner. Please don't release this kind of plugin. Take your time to learn and to release quality plugins.

Unapproved.
__________________

Last edited by Arkshine; 03-17-2015 at 14:25.
Arkshine is offline
Malli Bojan
Junior Member
Join Date: Apr 2014
Old 03-17-2015 , 16:17   Re: [DM] Frags, HS, Rank
Reply With Quote #5

PLUGIN Update to version 1.1

Code:
v1.1
 - Inserted SCORE HUD and SCREEN FADE
---------------------------------------------
 Changed the hud way.
 Inserted DHUD MESSAGE to Score Hud.

Last edited by Malli Bojan; 03-17-2015 at 16:17.
Malli Bojan is offline
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 15:26.


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