GetAllResources

From GTA Network Wiki
Jump to: navigation, search

GetAllResources
Server-Side Function

utilities-terminal.png Server-Side csharp.png C#

Get's an array of all available resources on the server.

Syntax

API.GetAllResources();

NOTE: This function returns data in string[] type.

Usage example(s)

Example Description

[Command("resources")]
public void resources(Client player)
{
    string[] resourcesList = API.GetAllResources(); //Get an array of all available resources on the server
    API.SendChatMessageToPlayer(player,"Resources loaded on server:");
	
    foreach (string resource in resourcesList) //Do a basic foreach loop through our array
    {
        API.SendChatMessageToPlayer(player,"- Resource: " + API.GetResourceName(resource));
    }
}

Changelog

Version Description
1.0 Release.

References