Business.GetBusiness
Skip to content
mnscript
Business Business.GetBusiness(string) 

Description ​

Returns a data structure containing publicly available data surrounding a business. A business object is dynamic and updates in realtime, along with its referenced business.

Arguments ​

string - The business name (Case sensitive)

Returns ​

Business - The business object

Example ​

msc
using Console;
using Business;
using Array;
using Player;

Business business = Business.GetBusiness("Egg");
string[] employees = business.GetEmployees();

number len = Array.Length(employees);
number i = 1;

// Print all the names of the employees and their role (if they're online)
while (i < len + 1)
{
    string sid = employees[i];
    Player ply = Player.GetBySteamID(sid);
    
    if (ply.IsValid())
    {
        // Get their role
        string role = business.GetEmployeeRole(ply);
        
        Console.WriteLine(ply.GetName() .. ": " .. role);
    }
    else
    {
        Console.WriteLine("Player wasn't online (" .. sid .. ")!");
    }
    
    i = i + 1;
}

// OUTPUT:
// Ventz: CEO
// Player wasn't online (STEAM_0:0:50203401)