Try this. I have no idea if StatusIcon can handle numbers over 9...
Why is everyone using
PHP Code:
register_event("SendAudio","roundend","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
when
PHP Code:
register_event("SendAudio", "roundend", "a", "1=0")
is easier..?
Code:
/*AMX MOD X script
**************************************************************************
* FragCounter V 1.01 by Scarzzurs
*
*
* *******************************************************************************
*
* Ported By KingPin( <a href="mailto:[email protected]">[email protected]</a> ). I take no responsibility
* for this file in any way. Use at your own risk. No warranties of any kind.
*
* ********************************************************************************
*
**********************************************************************************/
#include <amxmodx>
#define MAX_KILLS 20
new pfrags
[32]
new top
new gmsgStatusIcon
public playerspawn
(id
) {
pfrags
[id
]=0
top
= 0
showtimer
(id,pfrags
[id
])
}
public death
() {
new killer
= read_data(1)
pfrags
[killer
]=pfrags
[killer
]+1
if (pfrags
[killer
] >
= 9 )
emit_sound(killer,CHAN_STATIC,
"misc/monsterkill.wav",
1.0, ATTN_NORM,
0, PITCH_NORM
)
topplayer
()
new players
[32]
new player_num
get_players(players, player_num
)
for (new i
= 0; i < player_num; i
++)
showtimer
(players
[i
],pfrags
[players
[i
]])
return PLUGIN_CONTINUE
}
public topplayer
() {
new score
new players
[32]
new player_num
get_players(players, player_num
)
for (new i
= 0; i < player_num; i
++) {
if (pfrags
[players
[i
]]>score
) {
score
=pfrags
[players
[i
]]
top
=players
[i
]
}
else if ( pfrags
[players
[i
]] == score
)
top
= 0
}
}
public showtimer
(id,number
) {
if ( ! is_user_connected(id
) )
return PLUGIN_CONTINUE
for ( new i
= 0 ; i < MAX_KILLS ; i
++ ) {
new status, numstr
[10]
if ( i
== number
) {
status
= 1
if ( id
== top
)
status
= 2
}
formatex
(numstr,
9,
"number_%d", i
)
message_begin(MSG_ONE, gmsgStatusIcon,
{0,
0,
0}, id
)
write_byte(status
)
write_string(numstr
)
write_byte(0)
write_byte(255)
write_byte(0)
message_end()
}
return PLUGIN_CONTINUE
}
public roundend
() {
if (top
!= 0){
new sname
[32]
get_user_name(top,sname,
32)
set_hudmessage(0,
255,
0,
-1.0,
0.3,
0,
1.0,
5.0,
0.1,
0.2,
5)
show_hudmessage(0,
"Best player of the round: %s",sname
)
}
}
public plugin_init
() {
register_plugin("FragCounter",
"1.01",
"Scarzzurs")
gmsgStatusIcon
= get_user_msgid("StatusIcon")
register_event("DeathMsg",
"death",
"a")
register_event("ResetHUD",
"playerspawn",
"b")
register_event("SendAudio",
"roundend",
"a",
"1=0")
}
public plugin_precache
() {
if ( file_exists("sound/misc/monsterkill.wav") )
precache_sound("misc/monsterkill.wav")
}