> For the complete documentation index, see [llms.txt](https://docs.rytrak.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rytrak.fr/scripts/advanced-police-grab-ped/general-exports.md).

# General Exports

This page explains the available exports for the **r\_grab** script and their usage. These exports allow you to interact with the script programmatically from other resources.

All exports are client side only.

### **1. Exports Overview**

#### **1.1 Grab a Player**

```lua
exports['r_grab']:GrabPlayer(player)
```

**Description:**\
This export allows you to drag a specified player.

**Parameters:**

* `player`: The server ID of the player you want to grab.

***

#### **1.2 Put the Player in a Vehicle**

```lua
exports['r_grab']:PutPlayerInVehicle()
```

**Description:**\
This export places the currently dragged player into the nearest vehicle.

**Usage:**\
Make sure the dragged player is near a vehicle before calling this function.

***

#### **1.3 Remove the Player from a Vehicle**

```lua
exports['r_grab']:RemovePlayerFromVehicle()
```

**Description:**\
This export removes the currently dragged player from the vehicle they are in.

**Usage:**\
Call this function to pull the dragged player out of a vehicle.

***

#### **1.4 Check if the Player is Being Dragged**

```lua
exports['r_grab']:IsGrabbed()
```

**Description:**\
This export checks if a player is currently being dragged.

**Returns:**

* `true`: If the player is being dragged.
* `false`: If the player is not being dragged.

***

### **2. Example Usage**

Below is an example of how to use these exports in your script:

```lua
-- Grab a player by their server ID
exports['r_grab']:GrabPlayer(1)

-- Put the dragged player in the nearest vehicle
exports['r_grab']:PutPlayerInVehicle()

-- Remove the dragged player from the vehicle
exports['r_grab']:RemovePlayerFromVehicle()

-- Check if the local player is being dragged
if exports['r_grab']:IsGrabbed() then
    print("You are being dragged!")
else
    print("You are not being dragged.")
end
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.rytrak.fr/scripts/advanced-police-grab-ped/general-exports.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.
