I'm trying to rewrite antirush plugin and have some strange behavior... Here's some part of this plugin in which I traced a possible error.
PHP Code:
new players[32],inum
(...)
if(equal(g_team,"CT"))
{
get_players(players,inum,"ae","CT")
} else {
get_players(players,inum,"ae","TERRORIST")
}
log_amx("Count: %d",inum)
set_task(TEST_TIME, "checkOrigin", 1789)
log_amx("66")
for(new i=0;i<inum;i++) {
log_amx("x")
(...)
}
}
So it checkes which team can't rush and gets a list of alive players (ids) from that team. As You see I made some "debugging" using "log_amx". Here are the logs:
Code:
L 01/12/2007 - 23:33:04: [antirusher.amxx] T
L 01/12/2007 - 23:33:04: [antirusher.amxx] Count: 0
L 01/12/2007 - 23:33:04: [antirusher.amxx] 66
L 01/12/2007 - 23:33:08: [antirusher.amxx] T
L 01/12/2007 - 23:33:08: [antirusher.amxx] Count: 0
L 01/12/2007 - 23:33:08: [antirusher.amxx] 66
L 01/12/2007 - 23:33:12: [antirusher.amxx] T
L 01/12/2007 - 23:33:12: [antirusher.amxx] Count: 0
L 01/12/2007 - 23:33:12: [antirusher.amxx] 66
L 01/12/2007 - 23:33:16: [antirusher.amxx] T
L 01/12/2007 - 23:33:16: [antirusher.amxx] Count: 0
L 01/12/2007 - 23:33:16: [antirusher.amxx] 66
The server had ~10 players all the time, so what went wrong here? Maybe there's something I don't see :/ The "inum" should be larger than 0...
I put the same plugin on a perfect copy of my server, but for testing purposes (different port). I connected and here's what log said:
Code:
L 01/12/2007 - 23:37:23: [antirusher.amxx] T
L 01/12/2007 - 23:37:23: [antirusher.amxx] Count: 1
L 01/12/2007 - 23:37:23: [antirusher.amxx] 66
L 01/12/2007 - 23:37:23: [antirusher.amxx] x
L 01/12/2007 - 23:37:27: [antirusher.amxx] T
L 01/12/2007 - 23:37:27: [antirusher.amxx] Count: 1
L 01/12/2007 - 23:37:27: [antirusher.amxx] 66
L 01/12/2007 - 23:37:27: [antirusher.amxx] x
Here's the full source. Any idea?