AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Find ent in sphere (https://forums.alliedmods.net/showthread.php?t=221379)

~Ice*shOt 07-21-2013 08:24

Find ent in sphere
 
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++)
                }
        }




All times are GMT -4. The time now is 06:25.

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