# engine\_client

## is\_connected(): bool

Returns if you are connected to a server or not

```
if ( engine_client.is_connected() ) {

}
```

## is\_ingame(): bool

Returns if you are in game or not

```
if ( engine_client.is_ingame() ) {

}
```

## is\_voice\_recording(): bool

Returns if you are talking in voice chat or not

```
if ( engine_client.is_voice_recording() ) {

}
```

## is\_paused(): bool

Returns if the game is paused or not

```
if ( engine_client.is_paused() ) {

}
```

## **exec( cmd )**

Executes a console command. If the command is a cheat command and sv\_cheats is set to 0, the command won't be executed

| Type   | Name | Description                     |
| ------ | ---- | ------------------------------- |
| string | cmd  | The command you want to execute |

```
engine_client.exec( "buy scar20; buy ssg08" );
```

## get\_local\_player(): int

Returns the local player's entity index or -1 if not connected

```
var local_idx = engine_client.get_local_player();
```

## get\_view\_angles(): ang\_t

Returns current view angles

```
var angles = engine_client.get_view_angles();
```

## set\_view\_angles( angles )

Sets view angles

| Type   | Name   | Description                           |
| ------ | ------ | ------------------------------------- |
| ang\_t | angles | The view angles you want to end up at |

```
engine_client.set_view_angles( new ang_t( 0, 180, 0 ) );
```
