AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   "Frag" counter on every round (https://forums.alliedmods.net/showthread.php?t=221252)

Kirito 07-19-2013 17:01

"Frag" counter on every round
 
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)

Blizzard_87 07-20-2013 01:56

Re: "Frag" counter on every round
 
1 Attachment(s)
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
http://blzd.tk/img/download.png

Kirito 07-20-2013 07:23

Re: "Frag" counter on every round
 
Thank you! It works !

Diva 11-05-2013 08:13

Re: "Frag" counter on every round
 
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 :)


All times are GMT -4. The time now is 06:27.

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