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

[req]Need Frags n deaths n rank in HUD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
deepaklost
Member
Join Date: Jan 2011
Old 12-21-2011 , 04:23   [req]Need Frags n deaths n rank in HUD
Reply With Quote #1


hi guys i need frags , deaths n rank in HUD in top left below radar in green color..tried compiling together got errors.so not aware of it....pls help

can any1 combine this 2 plugin in 1

sma of frags n deaths & sma of ranks
Code:
#include <amxmodx>

#define PLUGIN  "Hud Frags Death" 
#define VERSION "1.0" 
#define AUTHOR  "Biscuit" 

new maxplayers
public plugin_init() 
{ 
    register_plugin( PLUGIN, VERSION, AUTHOR )
    maxplayers = get_maxplayers()
    set_task(1.0,"ShowHud",0,"",0,"b")
}

public ShowHud()
{
    for(new i = 1 ; i <= maxplayers ; i++)
    {
        new Frags = get_user_frags(i)
        new Deaths = get_user_deaths(i)
        set_hudmessage(255,255,255,0.02,0.2,0, 1.0, 1.0, 0.1, 0.2, 1)
        show_hudmessage(i,"Frags : %d ^nDeaths : %d",Frags,Deaths)
    }
}
Code:
 #include < amxmodx >
#include < csx >

const Float:REFRESH_RATE = 1.0;

public plugin_init( )
{
    register_plugin( "HUD Rank", "0.0.1", "Exolent" );
    
    set_task( REFRESH_RATE, "TaskShowRank", .flags = "b" );
}

public TaskShowRank( )
{
    new iPlayers[ 32 ], iNum;
    get_players( iPlayers, iNum, "ch" );
    
    new iPlayer, iStats[ 8 ];
    new iTotalStats = get_statsnum( );
    
    for( new i = 0; i < iNum; i++ )
    {
        iPlayer = iPlayers[ i ];
        
        set_hudmessage( 0, 255, 0, -0.01, -0.2, .holdtime = ( REFRESH_RATE + 0.2 ), .fadeintime = 0.1, .fadeouttime = 0.1, .channel = 3 );
        show_hudmessage( iPlayer, "Rank: %d / %d", get_user_stats( iPlayer, iStats, iStats ), iTotalStats );
    }
}

Last edited by deepaklost; 12-21-2011 at 04:28.
deepaklost is offline
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 12-21-2011 , 06:47   Re: [req]Need Frags n deaths n rank in HUD
Reply With Quote #2

Score Admin Info
__________________
vato loco [GE-S] is offline
deepaklost
Member
Join Date: Jan 2011
Old 12-21-2011 , 08:14   Re: [req]Need Frags n deaths n rank in HUD
Reply With Quote #3

thanks a lot..... working....
deepaklost is offline
Heartbeat
Member
Join Date: Nov 2011
Location: Denmark
Old 12-21-2011 , 09:05   Re: [req]Need Frags n deaths n rank in HUD
Reply With Quote #4

here you go!

PHP Code:
#include < amxmodx >
#include < csx >

#define PLUGIN  "Frags and Deaths" 
#define VERSION "1.0" 
#define AUTHOR  "fLaXXiE" 

const Float:REFRESH_RATE 1.0;
new 
maxplayers

public plugin_init() 

    
register_pluginPLUGINVERSIONAUTHOR )
    
maxplayers get_maxplayers()
    
set_task(1.0,"ShowHud",0,"",0,"b")
    
register_plugin"HUD Rank""0.0.1""Exolent" );
    
set_taskREFRESH_RATE"TaskShowRank", .flags "b" );
}

public 
ShowHud()
{
    for(new 
<= maxplayers i++)
    {
        new 
Frags get_user_frags(i)
        new 
Deaths get_user_deaths(i)
        
set_hudmessage(255,255,255,0.02,0.2,01.01.00.10.21)
        
show_hudmessage(i,"Frags : %d ^nDeaths : %d",Frags,Deaths)
    }
}

public 
TaskShowRank( )
{
    new 
iPlayers32 ], iNum;
    
get_playersiPlayersiNum"ch" );
    
    new 
iPlayeriStats];
    new 
iTotalStats get_statsnum( );
    
    for( new 
0iNumi++ )
    {
        
iPlayer iPlayers];
        
        
set_hudmessage02550, -0.01, -0.2, .holdtime = ( REFRESH_RATE 0.2 ), .fadeintime 0.1, .fadeouttime 0.1, .channel );
        
show_hudmessageiPlayer"Rank: %d / %d"get_user_statsiPlayeriStatsiStats ), iTotalStats );
    }

Attached Files
File Type: sma Get Plugin or Get Source (frags.sma - 873 views - 1.3 KB)

Last edited by Heartbeat; 12-21-2011 at 09:06.
Heartbeat is offline
deepaklost
Member
Join Date: Jan 2011
Old 12-21-2011 , 09:17   Re: [req]Need Frags n deaths n rank in HUD
Reply With Quote #5

oh.... thanks again... i made mistake by putting public plugin_init() twice, got it now... thanks for teaching....
deepaklost is offline
Heartbeat
Member
Join Date: Nov 2011
Location: Denmark
Old 12-21-2011 , 09:22   Re: [req]Need Frags n deaths n rank in HUD
Reply With Quote #6

Your welcome hope it helped you! :-)
Heartbeat is offline
avishek971
New Member
Join Date: Mar 2012
Old 03-16-2012 , 03:24   Re: [req]Need Frags n deaths n rank in HUD
Reply With Quote #7

Hey cant the rank as hud come under the frags n deaths except of coming at d corner....n change color frags n deaths to green..except of white..
avishek971 is offline
Danidude
Junior Member
Join Date: Apr 2012
Old 05-09-2012 , 06:42   Re: [req]Need Frags n deaths n rank in HUD
Reply With Quote #8

#include < amxmodx >
#include < csx >

#define PLUGIN "Frags and Deaths"
#define VERSION "2.0"
#define AUTHOR "Danidude"

const Float:REFRESH_RATE = 1.0;
new maxplayers

public plugin_init()
{
register_plugin( PLUGIN, VERSION, AUTHOR )
maxplayers = get_maxplayers()
set_task(1.0,"ShowHud",0,"",0,"b")
register_plugin( "HUD Rank", "0.0.1", "Exolent" );
set_task( REFRESH_RATE, "TaskShowRank", .flags = "b" );
}

public ShowHud()
{
for(new i = 1 ; i <= maxplayers ; i++)
{
new Frags = get_user_frags(i)
new Deaths = get_user_deaths(i)
set_hudmessage(0,255,0,0.02,0.2,0, 1.0, 1.0, 0.1, 0.2, 1)
show_hudmessage(i,"Frags : %d ^nDeaths : %d",Frags,Deaths)
}
}

public TaskShowRank( )
{
new iPlayers[ 32 ], iNum;
get_players( iPlayers, iNum, "ch" );

new iPlayer, iStats[ 8 ];
new iTotalStats = get_statsnum( );

for( new i = 0; i < iNum; i++ )
{
iPlayer = iPlayers[ i ];

set_hudmessage( 0,255,0,0.02,0.28, .holdtime = ( REFRESH_RATE + 0.2 ), .fadeintime = 0.1, .fadeouttime = 0.1, .channel = 3 );
show_hudmessage( iPlayer, "Rank: %d / %d", get_user_stats( iPlayer, iStats, iStats ), iTotalStats );
}
}

Here you go, display fixed

Last edited by Exolent[jNr]; 05-09-2012 at 20:14. Reason: Removed .amxx file.
Danidude is offline
Send a message via Skype™ to Danidude
omer
Senior Member
Join Date: Nov 2011
Old 05-09-2012 , 09:19   Re: [req]Need Frags n deaths n rank in HUD
Reply With Quote #9

Now this file will be removed Reason: you are not allowed to attach .amxx file ;)
__________________

omer is offline
Danidude
Junior Member
Join Date: Apr 2012
Old 05-09-2012 , 10:05   Re: [req]Need Frags n deaths n rank in HUD
Reply With Quote #10

The fade in time was useless so i removed it. here you go

#include < amxmodx >
#include < csx >

#define PLUGIN "Frags and Deaths"
#define VERSION "2.0"
#define AUTHOR "Danidude"

const Float:REFRESH_RATE = 1.0;
new maxplayers

public plugin_init()
{
register_plugin( PLUGIN, VERSION, AUTHOR )
maxplayers = get_maxplayers()
set_task(1.0,"ShowHud",0,"",0,"b")
register_plugin( "HUD Rank", "0.0.1", "Exolent" );
set_task( REFRESH_RATE, "TaskShowRank", .flags = "b" );
}

public ShowHud()
{
for(new i = 1 ; i <= maxplayers ; i++)
{
new Frags = get_user_frags(i)
new Deaths = get_user_deaths(i)
set_hudmessage(0,255,0,0.02,0.2,0, 1.0, 1.0, 0.1, 0.2, 1)
show_hudmessage(i,"Frags : %d ^nDeaths : %d",Frags,Deaths)
}
}

public TaskShowRank( )
{
new iPlayers[ 32 ], iNum;
get_players( iPlayers, iNum, "ch" );

new iPlayer, iStats[ 8 ];
new iTotalStats = get_statsnum( );

for( new i = 0; i < iNum; i++ )
{
iPlayer = iPlayers[ i ];

set_hudmessage( 0,255,0,0.02,0.28, .holdtime = ( REFRESH_RATE + 0.2 ), .fadeintime = 0.0, .fadeouttime = 0.0, .channel = 3 );
show_hudmessage( iPlayer, "Rank: %d / %d", get_user_stats( iPlayer, iStats, iStats ), iTotalStats );
}
}
Danidude is offline
Send a message via Skype™ to Danidude
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 10:43.


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