Raised This Month: $ Target: $400
 0% 

Find player using find_ent_in_sphere


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 05-20-2013 , 11:55   Re: Find player using find_ent_in_sphere
Reply With Quote #2

PHP Code:
new Float:origin[3];
entity_get_vector(player1EV_VEC_originorigin);

new 
player2 = -1;
    
while((
player2 find_ent_in_sphere(player2originTHE_RADIUS_YOU_WANT)) != 0)
{
    if(!
is_user_connected(player2)) continue;
    if(!
is_user_alive(player2)) continue;
    if(!
g_bTHE_BOOL_YOU_WANT[player2]) continue;
    
    
ExecuteHam(Ham_TakeDamageplayer10player2THE_DAMAGE_YOU_WANT);
}

/**************************************
*** Easier way to understand ***
**************************************/

new Float:origin[3];
entity_get_vector(player1EV_VEC_originorigin);

new 
player2 = -1;
    
while((
player2 find_ent_in_sphere(player2originTHE_RADIUS_YOU_WANT)) != 0)
{
    if(
is_user_connected(player2))
    {
        if(
is_user_alive(player2))
        {
            if(
g_bTHE_BOOL_YOU_WANT[player2])
            {
                
ExecuteHam(Ham_TakeDamageplayer10player2THE_DAMAGE_YOU_WANT);
            }
        }
    }


Last edited by didoWEE; 05-20-2013 at 12:02.
didoWEE 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:19.


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