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

kill counter


Post New Thread Reply   
 
Thread Tools Display Modes
jonny1990
Senior Member
Join Date: Apr 2020
Old 06-23-2020 , 12:13   Re: kill counter
Reply With Quote #11

Quote:
Originally Posted by OciXCrom View Post
Pay attention and you'll figure it out.
please do this
1) to reset the counter in a new round
2) I started showing it only when I made 1 frag already
3) hud --> dhud

Last edited by jonny1990; 06-23-2020 at 12:14.
jonny1990 is offline
jonny1990
Senior Member
Join Date: Apr 2020
Old 06-23-2020 , 12:15   Re: kill counter
Reply With Quote #12

#include <amxmodx>

#if !defined MAX_PLAYERS
const MAX_PLAYERS = 32
#endif

#if !defined client_disconnected
#define client_disconnected client_disconnect
#endif

#define COUNTER_COLOR 0, 255, 0
#define COUNTER_POSITION -1.0, 0.1

const Float:COUNTER_REFRESH = 1.0

enum _:FragInfo { Frags, Headshots }

new g_iFrags[MAX_PLAYERS + 1][FragInfo], g_iSyncObj

public plugin_init()
{
register_plugin("Frag Counter", "1.0", "OciXCrom")
register_event("DeathMsg", "OnPlayerKilled", "a")
g_iSyncObj = CreateHudSyncObj()
}

public client_putinserver(id)
{
g_iFrags[id][Frags] = 0
g_iFrags[id][Headshots] = 0
set_task(COUNTER_REFRESH, "display_frags", id, .flags = "b")
}

public client_disconnected(id)
{
remove_task(id)
}

public display_frags(id)
{
if(is_user_alive(id))
{
set_hudmessage(COUNTER_COLOR, COUNTER_POSITION, .holdtime = COUNTER_REFRESH)
ShowSyncHudMsg(id, g_iSyncObj, "%i (%i HS)", g_iFrags[id][Frags], g_iFrags[id][Headshots])
}
}

public OnPlayerKilled()
{
new iAttacker = read_data(1)

if(is_user_connected(iAttacker) && iAttacker != read_data(2))
{
g_iFrags[iAttacker][Frags]++

if(read_data(3))
{
g_iFrags[iAttacker][Headshots]++
}
}
}
jonny1990 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-23-2020 , 13:35   Re: kill counter
Reply With Quote #13

Code:
#include <amxmodx> #if AMXX_VERSION_NUM < 183 || !defined set_dhudmessage     #tryinclude <dhudmessage>     #if !defined _dhudmessage_included         #error "dhudmessage.inc" is missing in your "scripting/include" folder. Download it from: "https://amxx-bg.info/inc/"     #endif #endif #if !defined MAX_PLAYERS const MAX_PLAYERS = 32 #endif #if !defined client_disconnected     #define client_disconnected client_disconnect #endif #define COUNTER_COLOR 0, 255, 0 #define COUNTER_POSITION -1.0, 0.1 const Float:COUNTER_REFRESH = 1.0 enum _:FragInfo { Frags, Headshots } new g_iFrags[MAX_PLAYERS + 1][FragInfo] public plugin_init() {     register_plugin("Frag Counter", "1.1", "OciXCrom")     register_event("DeathMsg", "OnPlayerKilled", "a")     register_logevent("OnRoundStart", 2, "0=World triggered", "1=Round_Start") } public OnRoundStart() {     new iPlayers[MAX_PLAYERS], iPnum     get_players(iPlayers, iPnum)     for(new i; i < iPnum; i++)     {         reset_counter(iPlayers[i])     } } public client_putinserver(id) {     reset_counter(id)     set_task(COUNTER_REFRESH, "display_frags", id, .flags = "b") } public client_disconnected(id) {     remove_task(id) } public display_frags(id) {     if(is_user_alive(id) && g_iFrags[id][Frags])     {         set_dhudmessage(COUNTER_COLOR, COUNTER_POSITION, .holdtime = COUNTER_REFRESH)         show_dhudmessage(id, "%i (%i HS)", g_iFrags[id][Frags], g_iFrags[id][Headshots])     } } public OnPlayerKilled() {     new iAttacker = read_data(1)     if(is_user_connected(iAttacker) && iAttacker != read_data(2))     {         g_iFrags[iAttacker][Frags]++         if(read_data(3))         {             g_iFrags[iAttacker][Headshots]++         }     } } reset_counter(id) {     g_iFrags[id][Frags] = 0     g_iFrags[id][Headshots] = 0 }
__________________

Last edited by OciXCrom; 06-23-2020 at 13:36.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
jonny1990
Senior Member
Join Date: Apr 2020
Old 06-23-2020 , 14:05   Re: kill counter
Reply With Quote #14

Quote:
Originally Posted by OciXCrom View Post
Code:
#include <amxmodx> #if AMXX_VERSION_NUM < 183 || !defined set_dhudmessage     #tryinclude <dhudmessage>     #if !defined _dhudmessage_included         #error "dhudmessage.inc" is missing in your "scripting/include" folder. Download it from: "https://amxx-bg.info/inc/"     #endif #endif #if !defined MAX_PLAYERS const MAX_PLAYERS = 32 #endif #if !defined client_disconnected     #define client_disconnected client_disconnect #endif #define COUNTER_COLOR 0, 255, 0 #define COUNTER_POSITION -1.0, 0.1 const Float:COUNTER_REFRESH = 1.0 enum _:FragInfo { Frags, Headshots } new g_iFrags[MAX_PLAYERS + 1][FragInfo] public plugin_init() {     register_plugin("Frag Counter", "1.1", "OciXCrom")     register_event("DeathMsg", "OnPlayerKilled", "a")     register_logevent("OnRoundStart", 2, "0=World triggered", "1=Round_Start") } public OnRoundStart() {     new iPlayers[MAX_PLAYERS], iPnum     get_players(iPlayers, iPnum)     for(new i; i < iPnum; i++)     {         reset_counter(iPlayers[i])     } } public client_putinserver(id) {     reset_counter(id)     set_task(COUNTER_REFRESH, "display_frags", id, .flags = "b") } public client_disconnected(id) {     remove_task(id) } public display_frags(id) {     if(is_user_alive(id) && g_iFrags[id][Frags])     {         set_dhudmessage(COUNTER_COLOR, COUNTER_POSITION, .holdtime = COUNTER_REFRESH)         show_dhudmessage(id, "%i (%i HS)", g_iFrags[id][Frags], g_iFrags[id][Headshots])     } } public OnPlayerKilled() {     new iAttacker = read_data(1)     if(is_user_connected(iAttacker) && iAttacker != read_data(2))     {         g_iFrags[iAttacker][Frags]++         if(read_data(3))         {             g_iFrags[iAttacker][Headshots]++         }     } } reset_counter(id) {     g_iFrags[id][Frags] = 0     g_iFrags[id][Headshots] = 0 }
thank you
you can still make the counter show when I was killed
jonny1990 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-23-2020 , 15:01   Re: kill counter
Reply With Quote #15

Code:
if(is_user_alive(id) && g_iFrags[id][Frags])

=>

Code:
if(g_iFrags[id][Frags])
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
jonny1990
Senior Member
Join Date: Apr 2020
Old 06-23-2020 , 15:12   Re: kill counter
Reply With Quote #16

Quote:
Originally Posted by OciXCrom View Post
Code:
if(is_user_alive(id) && g_iFrags[id][Frags])

=>

Code:
if(g_iFrags[id][Frags])
noticed another thing that for example if I killed 2, then at the beginning of a new round, the counter appears seconds on 2 with these 2 kills
jonny1990 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-23-2020 , 15:28   Re: kill counter
Reply With Quote #17

The counter refreshes every 1 second so that's perfectly normal.
__________________

Last edited by OciXCrom; 06-23-2020 at 15:28.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
jonny1990
Senior Member
Join Date: Apr 2020
Old 06-23-2020 , 15:34   Re: kill counter
Reply With Quote #18

Quote:
Originally Posted by OciXCrom View Post
The counter refreshes every 1 second so that's perfectly normal.
this is understandable, I Pro the that why when revived in a new round of the on 2 seconds shows expense with past round of, can be whether to remove as any
jonny1990 is offline
Billyedz
Junior Member
Join Date: Jun 2020
Old 06-27-2020 , 07:04   Re: kill counter
Reply With Quote #19

OcixCrom.
by chance would not have this plugin for a win and kills counter for the danger zone csgo mode?
I searched the forum and found nothing about it
Billyedz is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-27-2020 , 07:37   Re: kill counter
Reply With Quote #20

Quote:
Originally Posted by Billyedz View Post
OcixCrom.
by chance would not have this plugin for a win and kills counter for the danger zone csgo mode?
I searched the forum and found nothing about it
This is an AMX Mod X plugin. CS:GO uses SourceMod. You're in the competely wrong forum so of course you won't find anything.
__________________

Last edited by OciXCrom; 06-27-2020 at 07:38.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 22:41.


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