rytrak.fr Documentation
  • 🛡️FiveM Assets Escrow
    • You lack the required entitlement
    • Failed to verify protected resource
    • Error parsing script / Failed to load script
  • ❓Store FAQ
    • Do you accept orders to create a custom script
    • Do you give decrypted scripts
    • What payment methods are accepted for the purchase of your scripts?
    • Do you offer discounts or special offers on your scripts?
    • Can I modify or customize your scripts to meet my needs
    • Are your scripts compatible with frameworks
    • Do you provide development assistance?
  • FiveM Scripts
    • 🚒Firefighter SCBA System
      • General Configuration
      • Adapt your EUP
      • General Exports
      • General Events
      • ❓FAQ
        • No such export IsFireNearby in resource SmartFires
      • Test it now
    • 👮‍♂️Advanced Police Grab Ped
      • General Configuration
      • General Exports
      • General Events
      • Compatibility with esx_policejob
      • Test it now
    • 🚿Advanced Pepper Spray
      • General Configuration
      • General Exports
      • Anticheat
      • Test it now
    • 📣Advanced Megaphone System
      • General Configuration
      • General Exports
      • Compatibility with pma-voice
      • Compatibility with mumble-voip
      • Compatibility with saltychat
      • ❓FAQ
        • I can't hear my voice through the megaphone
      • Test it now
    • 🚁Advanced Helicopter Bucket
      • General Configuration
      • Adapt our script with ToxicFire
      • General Exports
      • 🔐Test it now
    • 🔗Advanced Remote Restraint
      • General Configuration
      • General Exports
      • Test it now
    • 🚗Advanced Extrication System
      • General Configuration
      • General Exports
      • Adapt a vehicle to the roof system
      • List of vehicles compatible with the roof system
      • 🔐Test it now
    • 🔗Advanced Handcuffs System
      • General Configuration
      • General Exports
      • Make ESX compatible
      • Make QBCore compatible
      • Make OX-Inventory compatible
      • 🔐Test it now
    • ✈️Advanced Aerial Firefighting
      • General Configuration
      • Adapt our script with ToxicFire
      • General Exports
      • 🔐Test it now
    • 💣Advanced Tactical Gas System
      • General Configuration
      • Test it now
  • RedM Scripts
    • 🤠Advanced Sheriff Grab Ped
      • General Configuration
      • General Exports
  • Framework compatibility
    • Add a custom weapon on ESX
    • Add a custom weapon on QBCore
    • Add a custom weapon on OX Inventory
  • 🚀Test our resources for free with Zap-Hosting
Powered by GitBook
On this page
  • 1. Client-Side Events
  • 2. Server-Side Events
  • 3. Example Usage
  1. FiveM Scripts
  2. Advanced Police Grab Ped

General Events

This page explains the available events for the r_grab script and their usage. These events allow you to interact with the script programmatically from other resources.

1. Client-Side Events

1.1 Grab or Release a Player

Event Name: r_grab:client:grabPlayer

Description: This event allows grabbing or releasing a target player.

Parameters:

  • targetId (integer): The server ID of the player to grab.


1.2 Put the Grabbed Player in a Vehicle

Event Name: r_grab:client:putPlayerInVehicle

Description: Places the currently grabbed player into the nearest vehicle.


1.3 Remove the Grabbed Player from a Vehicle

Event Name: r_grab:client:removePlayerFromVehicle

Description: Removes the currently grabbed player from the vehicle they are in.


2. Server-Side Events

2.1 Initiate Grab Action

Event Name: r_grab:server:grabPlayer

Description: Initiates the grab action for a target player, ensuring the source and target are within range.

Parameters:

  • targetId (integer): The server ID of the player being grabbed.

Notes:

  • The function checks if the target ID is valid.

  • It verifies if the source player is within a 10.0 unit range of the target.

  • If conditions are met, it triggers client-side events to update both players.


3. Example Usage

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

-- [[ Grab or release a player ]]
-- Client to server
TriggerServerEvent('r_grab:server:grabPlayer', 1)
-- Server to client
TriggerClientEvent('r_grab:client:grabPlayer', source, 1)

-- [[ Put the grabbed player in a vehicle ]]
-- Only server to client
TriggerClientEvent('r_grab:server:putPlayerInVehicle', source)

-- [[ Remove the grabbed player from the vehicle ]]
-- Only server to client
TriggerClientEvent('r_grab:client:removePlayerFromVehicle', source)
PreviousGeneral ExportsNextCompatibility with esx_policejob

Last updated 3 months ago

👮‍♂️