AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   FragCounter - Count more (https://forums.alliedmods.net/showthread.php?t=46883)

DA 11-04-2006 14:40

FragCounter - Count more
 
Hey guys,

Ok. I have a nice plugin that counts the frags that you do on one respawn.
Then on the left side come a green number with the kills. Thus you spawn and kill one then comes on the left side a green "1". It's really nice on a dm server. But the problem is that he only count to 9. When I have killed 9 players and then one more then there showed a 9 but I have killed 10 people. :/

Here is the plugin.

The Specialist 11-04-2006 17:03

Re: FragCounter - Count more
 
1 Attachment(s)
ok here try this version i bumbped the stastus message number from 10 to 20 . try it out see if it works .:up:

DA 11-04-2006 19:30

Re: FragCounter - Count more
 
Thanks. I test it. :)

DA 11-05-2006 12:18

Re: FragCounter - Count more
 
hmm. Sorry but it works not :(
He count to 9 end then no more...

[ --<-@ ] Black Rose 11-05-2006 13:39

Re: FragCounter - Count more
 
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") }

The Specialist 11-05-2006 17:11

Re: FragCounter - Count more
 
Sorry i tried to help :cry: I thought the status message might be able to be altered appernatly not :cry:

DA 11-06-2006 09:17

Re: FragCounter - Count more
 
hmm. The other version is buggy too. When I have 9 kills and I kille one more then the green number on the left side goes away or invisible. I can't see the number then...

[ --<-@ ] Black Rose 11-06-2006 10:25

Re: FragCounter - Count more
 
I know, I tested it. It didn't work, Though I think I can remember seing some kinda counter on some warcraft servers, I also think it went over 9.

The Specialist 11-06-2006 14:43

Re: FragCounter - Count more
 
and technichly according to VEN, the way you went about detecting round end wasnt right either

http://forums.alliedmods.net/showthread.php?t=42159

:up:

[ --<-@ ] Black Rose 11-06-2006 15:00

Re: FragCounter - Count more
 
Quote:

Originally Posted by The Specialist (Post 400493)
and technichly according to VEN, the way you went about detecting round end wasnt right either

http://forums.alliedmods.net/showthread.php?t=42159

:up:

It doesn't say ANYWHERE that my way of doing it is wrong... it isn't even mentioned...


All times are GMT -4. The time now is 04:56.

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