Raised This Month: $51 Target: $400
 12% 

CSGO how to get all players in radius 5 meters and print them in chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 06-06-2019 , 11:20   CSGO how to get all players in radius 5 meters and print them in chat
Reply With Quote #1

hey, as the title say, need script where player can do like !radius and it will PrintToChat "Player X is in your radius" (all palyers names, not only one, if there is 3 guys in the radius print them also) , radius of 5 meters pls. thanks.
iskenderkebab33 is offline
Equiment
AlliedModders Donor
Join Date: Feb 2014
Old 06-06-2019 , 15:20   Re: CSGO how to get all players in radius 5 meters and print them in chat
Reply With Quote #2

PHP Code:
#include <sourcemod>

public OnPluginStart() 

    
RegConsoleCmd("sm_radius"Cmd_Radius); 


public 
Action:Cmd_Radius(clientargs

    new 
Float:client_pos[3]; 
    
GetClientAbsOrigin(clientclient_pos); 
    for(new 
1<= MaxClientsi++) 
    { 
        if(
IsClientInGame(i) && IsPlalyerAlive(i) && != client
        { 
            new 
Float:i_pos[3]; 
            
GetClientAbsOrigin(ii_pos); 
            if(
RoundFloat(GetVectorDistance(i_posclient_pos) <= 500
            { 
                
PrintToChat(client"Player %N is in your radius"i); 
            } 
        } 
    } 


Last edited by Equiment; 06-06-2019 at 15:20.
Equiment is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 06-06-2019 , 15:40   Re: CSGO how to get all players in radius 5 meters and print them in chat
Reply With Quote #3

Quote:
Originally Posted by Equiment View Post
PHP Code:
#include <sourcemod>

public OnPluginStart() 

    
RegConsoleCmd("sm_radius"Cmd_Radius); 


public 
Action:Cmd_Radius(clientargs

    new 
Float:client_pos[3]; 
    
GetClientAbsOrigin(clientclient_pos); 
    for(new 
1<= MaxClientsi++) 
    { 
        if(
IsClientInGame(i) && IsPlalyerAlive(i) && != client
        { 
            new 
Float:i_pos[3]; 
            
GetClientAbsOrigin(ii_pos); 
            if(
RoundFloat(GetVectorDistance(i_posclient_pos) <= 500
            { 
                
PrintToChat(client"Player %N is in your radius"i); 
            } 
        } 
    } 

thanks, but why in old syntax
iskenderkebab33 is offline
Pilo
AlliedModders Donor
Join Date: Jan 2019
Location: Israel
Old 06-06-2019 , 16:46   Re: CSGO how to get all players in radius 5 meters and print them in chat
Reply With Quote #4

Quote:
Originally Posted by iskenderkebab33 View Post
thanks, but why in old syntax
PHP Code:
#include <sourcemod>

public void OnPluginStart()
{
    
RegConsoleCmd("sm_radius"Cmd_Radius);
}

public 
Action Cmd_Radius(int clientint args)
{
    
float client_pos[3];
    
GetClientAbsOrigin(clientclient_pos);
    for(
int i 1<= MaxClientsi++)
    {
        if(
IsClientInGame(i) && IsPlayerAlive(i) && != client)
        {
            
float i_pos[3];
            
GetClientAbsOrigin(ii_pos);
            if(
RoundFloat(GetVectorDistance(i_posclient_pos) <= 500))
            {
                
PrintToChat(client"Player %N is in your radius"i);
            }
        }
    }

__________________

Taking Private(PAID) Plugins In PM
Feel free to Donate with PayPal
Feel free to message me in Discord Pilo#8253
Total donated : 25$
Pilo is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 06-07-2019 , 09:37   Re: CSGO how to get all players in radius 5 meters and print them in chat
Reply With Quote #5

Quote:
Originally Posted by Pilo View Post
PHP Code:
#include <sourcemod>

public void OnPluginStart()
{
    
RegConsoleCmd("sm_radius"Cmd_Radius);
}

public 
Action Cmd_Radius(int clientint args)
{
    
float client_pos[3];
    
GetClientAbsOrigin(clientclient_pos);
    for(
int i 1<= MaxClientsi++)
    {
        if(
IsClientInGame(i) && IsPlayerAlive(i) && != client)
        {
            
float i_pos[3];
            
GetClientAbsOrigin(ii_pos);
            if(
RoundFloat(GetVectorDistance(i_posclient_pos) <= 500))
            {
                
PrintToChat(client"Player %N is in your radius"i);
            }
        }
    }

thanks!
iskenderkebab33 is offline
Reply



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 09:30.


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