# Server

### Obtain reports of a player

Returns a table with the reports of the player

```lua
--- @param sourceOrId integer|string  server source OR identifier string
--- @return table  list of report tables (copies, not references)
exports[silio_reports]:GetUserReports(sourceOrId)
```

#### Explanation

* `sourceOrId` -> online server id of the player or identifier of the player. Auto selected based on if the param is a string or a integer
* `return` -> table with all the reports of the player with some info of each report return by the export

### Obtein the status of a report

Returns the status of a report or nil if not found

```lua
--- @param reportId integer
--- @return string|nil  "pendiente" | "resuelto" | nil
exports['silio_reports']:GetReportStatus(reportId)
```

#### Explanation

* `reportId` -> id of the report we want to obtain the status
* `return` -> string with the status of the report or nil if not found

### Obtain full information of a report

Returns a table with the information of a report

```lua
--- @param reportId integer
--- @return table|nil
exports['silio_reports']:GetReport(reportId)
```

#### Explantation

`reportId` -> id of the report we want to obtein the table with the information

`return` -> table with the full information of the report id introduced or nil if not results

### Obtain a table with all the pending reports

Returns a table with all the pending reports

```lua
--- @return table
exports['silio_reports']:GetPendingReports()
```

#### Explanation

`return` -> table with all the pending reports and their information

### Obtain a table with all the reports regardless of their status

Returns a table with all the available reports

```lua
--- @return table
exports['silio_reports']:GetAllReports()
```

#### Explanation

`return` -> table with all the reports found

### Change the status of a report to resolved

Change the status of a report that was pending into resolved

```lua
--- @param reportId integer
--- @return boolean  true if status changed
exports['silio_reports']:CloseReport(reportId)
```

#### Explanation

`reportId` -> id of the report we want to change the status into resolved

`return` -> true if the status was successfully change and false if not

### Delete a report regardless of it's status

Delete completly the report regardless of the status. Can be deleted being resolved or pending

```lua
--- @param reportId integer
--- @return boolean  true if deleted
exports['silio_reports']:DeleteReport(reportId)
```

#### Explanation

`reportId` -> id of the report we want to delete

`return` -> true if the report was successfully deleted or false it wasn't deleted

### Get the amount of pending reports

Returns an integer with the number of the pending reports

```lua
--- @return integer
exports['silio_reports']:GetPendingCount()
```

#### Explanation

`return` -> integer of the number of pending reports

### Get online admins

Returns a list of online admins with their server id

```lua
--- @return table
exports['silio_reports']:GetOnlineAdmins()
```

#### Explanation

`return` -> list of the server id of the online admins


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://silio-scripts.gitbook.io/silio-scripts/scripts/silio-reports/exports/server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
