Raised This Month: $ Target: $400
 0% 

"Frag" counter on every round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kirito
New Member
Join Date: Jul 2013
Old 07-19-2013 , 17:01   "Frag" counter on every round
Reply With Quote #1

Hello. I have a code what counts client's score at the left corner. It's working, but I wanna do a few things;
  • Reset itself on roundstart then count again
  • Keep the score at the scoreboard
  • Money-like counter (maybe)

Like on this picture (red 9 at left)

My code looks like this:

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

#define MIN_KILLS 1 
 
#define PLUGIN  "Frags"  
#define VERSION "1.0"  
#define AUTHOR  "Author"  
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""0.0.1""Dashie" ); 
    
set_taskREFRESH_RATE"TaskShowRank", .flags "b" ); 

public 
ShowHud() 

    for(new 
<= maxplayers i++) 
    { 
        new 
Frags get_user_frags(i
        
set_hudmessage(2552552550.0230.9406.060.0)
        
show_hudmessage(i,"Frag : %d",Frags
    } 

So how can I do the reset without doing a score reset?
(srry for my bad english, I'm a bit tired)
Kirito is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 07-20-2013 , 01:56   Re: "Frag" counter on every round
Reply With Quote #2

i wasnt going to fix your code for you as its not good. instead i wrote one up for you... and put some notes in it... im not the best at explaining things but hope you can understand.

Code:
/*     Blizzards Plugins Comply With GNU General Public License     Frag Counter is free software: you can redistribute it and/or modify     it under the terms of the GNU General Public License as published by     the Free Software Foundation, either version 3 of the License, or     (at your option) any later version.         Under no circumstances are you allowed to redistribute and/or modify     it claming that you are the original author of such plugin/modification.         Frag Counter is distributed in the hope that it will be useful,     but WITHOUT ANY WARRANTY; without even the implied warranty of     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     GNU General Public License for more details.         You should have received a copy of the GNU General Public License     along with this program.  If not, see <http://www.gnu.org/licenses/>.     */ #include < amxmodx > #include < amxmisc > #include < hamsandwich > #pragma semicolon 1 #define PLUGIN "Frag Counter" #define VERSION "1.0" #define AUTHOR "Blizzard" new g_iFrags[ 33 ]; // This Holds Players Kill Count public plugin_init( ) {     register_plugin( PLUGIN, VERSION, AUTHOR );         RegisterHam( Ham_Spawn, "player", "CBase_PlayerPre_Spawn", 0 );     register_event( "DeathMsg", "Event_DeathMsg", "a" ); } public client_putinserver( id ) {     set_task( 0.9, "Frag_Hud", id, _, _, "b" ); // Sets The Loop Task For Hud } public CBase_PlayerPre_Spawn( id ) {     arrayset( g_iFrags, 0, sizeof( g_iFrags ) ); // This Resets Players Frag Count To 0 Only For HUD Does Not Affect ScoreBoard } public Event_DeathMsg( ) {     new iKiller = read_data( 1 );     new iVictim = read_data( 2 );         if( iVictim != iKiller ) {         g_iFrags[ iKiller ]++; // This Adds +1 To A Persons Frag Count For HUD     } } public Frag_Hud( id ) {     set_hudmessage(255, 255, 255, 0.01, 0.18, 0, 0.0, 1.0, 0.0, 0.0, -1 );     show_hudmessage(id, "Round Stats:^nFrags %i", g_iFrags[ id ] ); }

or you could simply get the plugin from link below
Attached Files
File Type: sma Get Plugin or Get Source (frags-counter.sma - 993 views - 1.9 KB)
__________________
Blizzard_87 is offline
Kirito
New Member
Join Date: Jul 2013
Old 07-20-2013 , 07:23   Re: "Frag" counter on every round
Reply With Quote #3

Thank you! It works !
Kirito is offline
Diva
Member
Join Date: Aug 2012
Location: Denmark
Old 11-05-2013 , 08:13   Re: "Frag" counter on every round
Reply With Quote #4

possible if u could re-edit it to show the "9" in red with that different HUD it has in Kirito's screenshot ?
anyone. thanks
Diva 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 06:27.


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