Raised This Month: $ Target: $400
 0% 

get_players problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KobraPL
Junior Member
Join Date: Oct 2006
Location: Poland, Krakow
Old 01-12-2007 , 18:31   get_players problem
Reply With Quote #1

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?
Attached Files
File Type: sma Get Plugin or Get Source (antirusher.sma - 854 views - 7.8 KB)
__________________
KobraPL is offline
Old 01-13-2007, 02:17
allenwr
This message has been deleted by allenwr. Reason: i was wrong.
Salepate
Junior Member
Join Date: Jan 2007
Old 01-13-2007 , 06:28   Re: get_players problem
Reply With Quote #3

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

It's "T"

Last edited by Salepate; 01-13-2007 at 06:42.
Salepate is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 01-13-2007 , 07:07   Re: get_players problem
Reply With Quote #4

CS_TEAM_CT isn't a string but enum constant.
And no, it's TERRORIST.
VEN is offline
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:28.


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