Raised This Month: $ Target: $400
 0% 

CZ Bots + AMXX 1.70 + auto bot script = crashing


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Redshift187
Junior Member
Join Date: Mar 2008
Old 03-26-2008 , 18:29   Re: CZ Bots + AMXX 1.70 + auto bot script = crashing
Reply With Quote #2

That's funny, I'm working on a script to do exactly the same thing!

I see two potential problems. First, I wouldn't put a new inside a for loop. It's more efficient to create it once, and reuse it in the for loop. This may be the source of your crashing.

Second, this code is wrong:

PHP Code:
get_players(PlayerListPlayerCount"c"); 
   for (new 
i=0i<PlayerCounti++) 
It should be:

PHP Code:
for (new 133i++) 
because cs_get_user_team() takes a parameter of 1 to 32, NOT 0 to 31 (player ID 0 is reserved for specifying all users) AND the player list is not always contiguous (there may be empty slots in the player array). You may also need to check every ID with is_user_connected(i) before you call cs_get_user_team() or that call may fail.

Last edited by Redshift187; 03-27-2008 at 10:00.
Redshift187 is offline
 



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 16:29.


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