> 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
```
