Raised This Month: $ Target: $400
 0% 

Loop wont run more than 4 times


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 04-06-2011 , 16:16   Loop wont run more than 4 times
Reply With Quote #1

I have this very weird problem, my loop wont run for more than 4 times. Sometimes it runs just once and other times it runs 4 times. Completely random how it runs.

PHP Code:
public zp_round_started(gamemodeid)
{
    
client_print(0print_chat"[Debug] round started")
    new 
players[32], playerCountiplayer
    get_players
(playersplayerCount"ah")
    
    for ( 
032i++ )
    {
        
player players[i]
        
        
client_print(0print_chat"[Debug] loop is running %d"player)
        
        if ( 
zp_get_user_zombie(player) || zp_get_user_nemesis(player) ) return
        
        
client_print(playerprint_chat"[Debug] You are human")
        
        if ( 
gHasSuperman[player] )
        {
            
client_print(playerprint_chat"[Debug] Giving powers...")
            
sh_set_bonus_hp(playerget_pcvar_num(pcvarHealth))
            
sh_set_bonus_ap(playerget_pcvar_num(pcvarArmor))
            
set_user_gravity(playerget_pcvar_float(pcvarGravity))
        }
    }

As you can see I have tried various debugs in my code, and it never gets any longer than to "loop running 4", so I'm guessing that the loop is done wrong?
I have replaced 32 with "playerCount" to try and force it to run 32 times, but no luck there either.
How can this be happening?

EDIT:
Oh, now it just ran 6 times and apparently I did have one of those id's, and the only thing I got was bonus HP and AP, no gravity for me, nor did I get any debug message.
__________________
No idea what to write here...

Last edited by Jelle; 04-06-2011 at 16:20.
Jelle is offline
Send a message via MSN to Jelle
 


Thread Tools
Display Modes

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 19:57.


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