Raised This Month: $ Target: $400
 0% 

Solved Detect distance between Players


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Saint Sinner
Senior Member
Join Date: Feb 2016
Old 06-08-2019 , 15:55   Detect distance between Players
Reply With Quote #1

I want to detect distance between Id and another players...But something is wrong here

Code:
public client_PreThink(id)
{
    new Float:myOrigin[ 3 ], Float:hisOrigin[ 3 ];
    
    new Float:fDistance  

    pev( id, pev_origin, myOrigin )

    for(new i = 1 ; i <= maxplayers; i++)
    {
        pev(i, pev_origin, hisOrigin)
        fDistance = get_distance_f( myOrigin, hisOrigin)

        if( fDistance <= 62.0)
        {
            client_print(id , print_center, "Distance to entity: %.2f", fDistance )
        }

    }
}

Last edited by Saint Sinner; 06-11-2019 at 11:35.
Saint Sinner 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 17:17.


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