I'm trying to choose a random item from a item list stored in a string. How can i do that ?
My attempt:
Code:
#include <sourcemod>
static const String: Items[][] =
{
"Item1",
"Item2",
"Item3"
}
public OnPluginStart()
{
RegConsoleCmd( "items", Command_ChooseItems )
}
public Action: Command_ChooseItems( client, args )
{
for( new i = 0; i < sizeof( Items ); i++ )
{
new ChoosedItem = GetRandomInt( Items[ i ] )
PrintToChatAll( "Server choosed %s", ChoosedItem )
}
}