From GT-MP
Jump to: navigation, search
Server-Side Function
Utilities-terminal.png Server-Side Csharp.png C#

Function Description


API.getPlayersInRadiusOfPlayer(float radius, Client player);

Required Arguments

  • radius: parameter input should be in float type.
  • player: parameter input should be in Client type.

NOTE: This function returns data in List type.

Usage example(s)

Example Description

    [Command("write", GreedyArg = true)]
    public void writeMessageInRadius(Client player, string message){
        List<Client> playerList = API.getPlayersInRadiusOfPlayer(20, player);
        foreach(Client playerItem in playerList){
            API.sendChatMessageToPlayer(playerItem," say: "+message); // The Message is only seen by players in a radius of 20