> For the complete documentation index, see [llms.txt](https://pika-soft.gitbook.io/rsc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pika-soft.gitbook.io/rsc/api/utilities.md).

# Utilities

## RSC.HasAccess

```rust
RSC.HasAccess( ply: Entity, cb: function(bool) )
```

Checks if specified player can use screengrabber. Calls `cb` argument with boolean passed. Passes true if player have access, otherwise false.

{% hint style="warning" %}
On clientside this function only checks local player. Argument `ply` ignored.
{% endhint %}

## RSC.AsyncHasAccess

```rust
Promise<bool> RSC.AsyncHasAccess( ply: Entity )
```

Same as [RSC.HasAccess](#rsc.hasaccess). Instead of calling callback returns a [promise](https://github.com/dankmolot/gm_promise) that fulfilled with boolean.

## RSC.CanScreengrab

```rust
RSC.CanScreengrab( receiver: Entity, victim: Entity, cb: function(bool) )
```

Checks if specified receiver can screengrab victim. Calls `cb` argument with passed boolean. Passes true if receiver can screengrab victim.

## RSC.AsyncCanScreengrab

```rust
Promise<bool> RSC.AsyncCanScreengrab( receiver: Entity, victim: Entity )
```

Same as [RSC.CanScreengrab](#rsc.canscreengrab). Instead of calling callback returns a [promise](https://github.com/dankmolot/gm_promise) that fulfilled with boolean.

## RSC.ParseQuality

```rust
str, number RSC.ParseQuality( quality: number )
```

Returns image format (png or jpeg) and jpeg quality.\
If quality == 2 then returns png image format\
If quality == 1 or 2 then returns jpeg image format and 80 or 60 jpeg quality

```lua
RSC.ParseQuality(2) -- "png", 80
RSC.ParseQuality(1) -- "jpeg", 80
RSC.ParseQuality(0) -- "jpeg", 60
```

## RSC.FindPlayer

<pre class="language-rust"><code class="lang-rust"><strong>Entity/nil RSC.FindPlayer( searchString: str )
</strong></code></pre>

Finds player by search string. Can search by steamid, steamid64 and part of a player name. Returns entity if found, otherwise nil

## RSC.Capture

```rust
RSC.Capture( quality: number, onMessage: function(MESSAGE_TYPE, str), onResult: function(bool, str) )
```

This function is used internally to capture local screen.

{% hint style="info" %}
This is clientside function
{% endhint %}

{% hint style="warning" %}
This function is used internally. You probably shouldn't use it.
{% endhint %}
