Business.IsEmployeeOf
Skip to content
mnscript
bool Business.IsEmployeeOf(string, Player) 

Description ​

Returns whether the Player is an employee of a business

Arguments ​

string - The business name (Case sensitive)
Player - The Player to check

Returns ​

bool - True if the player is an employee of this business

Example ​

msc
using Console;
using Player;
using Business;

Player ply = Player.GetBySteamID("STEAM_0:0:50203401");

if (Business.IsEmployeeOf("Big Bonk", ply))
{
    Console.WriteLine(ply.GetName() .. " is a member of Big Bonk!")
}
// Business.IsEmployeeOf checks if the player is invalid internally, guaranteeing that we can call ply.GetName() safely above. If we returned false,
// it may be because our player WASN'T valid. Let's check this before continueing:
else
{
    if (ply.IsValid()) 
    {
        Console.WriteLine(ply.GetName() .. " is NOT a member of Big Bonk!")
    }
    else // We must be invalid :c
    {
        Console.WriteLine("Player was invalid!")
    }
}