Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<int> GetPlayersNearThePlayer(float distance)
- {
- List<int> Close_Players = new List<int>();
- for(int i = 0; i < 32; i++)
- {
- if(API.NetworkIsPlayerConnected(i) && i != API.PlayerId())
- {
- Vector3 Other_Player_Position = API.GetEntityCoords(API.GetPlayerPed(i), true);
- Vector3 The_Player_Position = API.GetEntityCoords(Game.Player.Handle, true);
- 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 )
- {
- Close_Players.Add(i);
- }
- }
- }
- return Close_Players;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement