Raised This Month: $ Target: $400
 0% 

Help with while


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Kiske
Veteran Member
Join Date: May 2009
Old 07-31-2011 , 15:18   Help with while
Reply With Quote #1

Hi.
I have a question.

Code:
PHP Code:
#define is_user_valid_alive(%1) (1 <= %1 <= g_maxplayers && is_user_alive(id))

register_forward(FM_Think"fw_Think")

public 
fw_think(entity)
{
    static 
classname[32], model[64]
    
pev(entitypev_classnameclassnamecharsmax(classname))
    
    if(
equal(classname"bad_zone"))
    {
        new 
= -1
        
new Float:ent_origin[3]

        
pev(entitypev_originent_origin)
        
        while((
find_ent_in_sphere(eent_origin200.0)) != 0)
        {
            
pev(epev_modelmodelcharsmax(model))
            if(
equal(model"models/balls/w_ball3.mdl")) break;
            if(!
is_user_valid_alive(e)) continue;
            
            
// ...
        
}
        
        
set_pev(entitypev_nextthinkget_gametime() + 0.1)
    }

Why the while works for the players when the entity that the model has it's inside the radio ?

Thanks in advanced.
Kiske is offline
Send a message via Skype™ to Kiske
 



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 03:24.


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