Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1. public List<int> GetPlayersNearThePlayer(float distance)
  2.         {
  3.             List<int> Close_Players = new List<int>();
  4.             for(int i = 0; i < 32; i++)
  5.             {
  6.                 if(API.NetworkIsPlayerConnected(i) && i != API.PlayerId())
  7.                 {
  8.                     Vector3 Other_Player_Position = API.GetEntityCoords(API.GetPlayerPed(i), true);
  9.                     Vector3 The_Player_Position = API.GetEntityCoords(Game.Player.Handle, true);
  10.                     if(API.GetDistanceBetweenCoords(The_Player_Position.X, The_Player_Position.Y, The_Player_Position.Z, Other_Player_Position.X, Other_Player_Position.Y, Other_Player_Position.Z, true) <= distance )
  11.                     {
  12.                         Close_Players.Add(i);
  13.                     }
  14.                 }
  15.             }
  16.             return Close_Players;
  17.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement