Saltar al contenido principal

is_profile_active_fact

Returns 1 if the specified profile is active, 0 otherwise — fact entry.

Entry Information

PropertyValue
Entry IDis_profile_active_fact
TypeFact
ColorBlue
Iconmdi:account-star

Description

Fact that returns the number of profiles a player has. / @Entry( "profile_count_fact", "Returns the number of profiles a player has", Colors.BLUE, "mdi:counter" ) @Tags("profiles", "fact") class ProfileCountFactEntry( override val id: String = "", override val name: String = "", @MultiLine @Help("A comment to keep track of what this fact is used for.") override val comment: String = "", @Help("If left empty, every player has its own group.") override val group: Ref<GroupEntry> = emptyRef(), ) : ReadableFactEntry { override fun readSinglePlayer(player: Player): FactData { return FactData(ProfilesAPI.getProfileCount(player)) } } /** Fact that returns 1 if the player has an active profile, 0 otherwise. / @Entry( "has_active_profile_fact", "Returns 1 if player has an active profile, 0 otherwise", Colors.BLUE, "mdi:account-check" ) @Tags("profiles", "fact") class HasActiveProfileFactEntry( override val id: String = "", override val name: String = "", @MultiLine @Help("A comment to keep track of what this fact is used for.") override val comment: String = "", @Help("If left empty, every player has its own group.") override val group: Ref<GroupEntry> = emptyRef(), ) : ReadableFactEntry { override fun readSinglePlayer(player: Player): FactData { return FactData(if (ProfilesAPI.hasActiveProfile(player)) 1 else 0) } } /** Fact that returns 1 if the player's active profile is a coop profile, 0 otherwise. Used to gate the BTC Sky coop-invite button: a solo profile has nothing to share, so the button is hidden via a criteria on this fact. / @Entry( "profile_coop_enabled_fact", "Returns 1 if the active profile was created as a coop profile", Colors.BLUE, "mdi:account-multiple-plus" ) @Tags("profiles", "fact", "coop") class ProfileCoopEnabledFactEntry( override val id: String = "", override val name: String = "", @MultiLine @Help("A comment to keep track of what this fact is used for.") override val comment: String = "", @Help("If left empty, every player has its own group.") override val group: Ref<GroupEntry> = emptyRef(), ) : ReadableFactEntry { override fun readSinglePlayer(player: Player): FactData { return FactData(if (ProfilesAPI.isCoopEnabled(player)) 1 else 0) } } /** Fact that returns the maximum number of profiles allowed. / @Entry( "max_profiles_fact", "Returns the maximum number of profiles allowed per player", Colors.BLUE, "mdi:numeric" ) @Tags("profiles", "fact") class MaxProfilesFactEntry( override val id: String = "", override val name: String = "", @MultiLine @Help("A comment to keep track of what this fact is used for.") override val comment: String = "", @Help("If left empty, every player has its own group.") override val group: Ref<GroupEntry> = emptyRef(), ) : ReadableFactEntry { override fun readSinglePlayer(player: Player): FactData { return FactData(ProfilesAPI.getMaxProfiles(player)) } } /** Fact that returns 1 if the player can create more profiles, 0 otherwise. / @Entry( "can_create_profile_fact", "Returns 1 if player can create more profiles, 0 otherwise", Colors.BLUE, "mdi:account-plus" ) @Tags("profiles", "fact") class CanCreateProfileFactEntry( override val id: String = "", override val name: String = "", @MultiLine @Help("A comment to keep track of what this fact is used for.") override val comment: String = "", @Help("If left empty, every player has its own group.") override val group: Ref<GroupEntry> = emptyRef(), ) : ReadableFactEntry { override fun readSinglePlayer(player: Player): FactData { return FactData(if (ProfilesAPI.canCreateProfile(player)) 1 else 0) } } /** Fact that returns 1 if the profile system is enabled, 0 otherwise. / @Entry( "profiles_enabled_fact", "Returns 1 if the profile system is enabled, 0 otherwise", Colors.BLUE, "mdi:toggle-switch" ) @Tags("profiles", "fact") class ProfilesEnabledFactEntry( override val id: String = "", override val name: String = "", @MultiLine @Help("A comment to keep track of what this fact is used for.") override val comment: String = "", @Help("If left empty, every player has its own group.") override val group: Ref<GroupEntry> = emptyRef(), ) : ReadableFactEntry { override fun readSinglePlayer(player: Player): FactData { return FactData(if (ProfilesAPI.isEnabled()) 1 else 0) } } /** Fact that checks if a specific profile ID matches the active profile.

Fields

FieldTypeDescription
commentStringA comment to keep track of what this fact is used for.
groupRef<GroupEntry>If left empty, every player has its own group.
profileIdStringThe profile ID to check.

Usage Example

- entry: is_profile_active_fact
name: "Returns 1 if the specified profile is active, 0 otherwise"
comment: ""
group: ""
profileId: ""