Raised This Month: $ Target: $400
 0% 

Find ent in sphere


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 07-21-2013 , 08:24   Find ent in sphere
Reply With Quote #1

Hello, I'm trying to do that if player is in distance for him will be shown counting, but how to set count to 1 if player was in distance and goes away?. And need to do this: if one player is in distance, and counting started for other players in distance this func just don't work.

PHP Code:
public Think(Ent)
{
        if (!
is_valid_ent(Ent))
                return
 
        
entity_set_float(EntEV_FL_nextthinkget_gametime() + 1.0)
 
        static 
Count
        Count 
1
        
static id
        id 
= -1
 
        
while ((id find_ent_in_sphere(idOriginDistance)) != 0)
        {
                if (
<= id <= MaxPlayers && is_user_alive(id))
                {
                        
client_print(id3"%d"Count++)
                }
        }


Last edited by ~Ice*shOt; 07-21-2013 at 08:24.
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
Old 07-21-2013, 13:20
~Ice*shOt
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
Reply


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 06:25.


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