AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get_players problem (https://forums.alliedmods.net/showthread.php?t=49777)

KobraPL 01-12-2007 18:31

get_players problem
 
1 Attachment(s)
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?

Salepate 01-13-2007 06:28

Re: get_players problem
 
You wrote :
Code:
get_players(players,inum,"ae","TERRORIST");

It's "T"

VEN 01-13-2007 07:07

Re: get_players problem
 
CS_TEAM_CT isn't a string but enum constant.
And no, it's TERRORIST.


All times are GMT -4. The time now is 22:28.

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