GetAllResources

From GT-MP
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));
	}
}

References