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. Exports Overview
  • 2. Example Usage
  1. FiveM Scripts
  2. Advanced Pepper Spray

General Exports

This page explains the available exports for the r_pepperspray script and how to use them. These client-side exports allow you to interact programmatically with the pepper spray system from other resources.


1. Exports Overview

1.1 SetGassedPlayer

exports['r_pepperspray']:SetGassedPlayer(weaponName)

Description: Applies the gas effect to the player based on the specified command (e.g., pepper spray).

Parameters:

  • weaponName: The command identifying the type of gas effect to apply (e.g., pepper spray).


1.2 RemoveGas

exports['r_pepperspray']:RemoveGas()

Description: Removes the gas effect from the player.


1.3 SetPepperQuantity

exports['r_pepperspray']:SetPepperQuantity(quantity)

Description: Sets the amount of spray available to the player (either pepper spray or decontamination spray).

Parameters:

  • quantity (number): The amount of spray to set for the player.


1.4 IsGassed

exports['r_pepperspray']:IsGassed()

Description: Returns whether the player is currently gassed or not.

Returns:

  • true: If the player is gassed.

  • false: If the player is not gassed.


2. Example Usage

Here’s a basic example of how to use the pepper spray exports:

-- Apply the pepper spray effect to the player
exports['r_pepperspray']:SetGassedPlayer('pepper_spray')

-- Remove the gas effect from the player
exports['r_pepperspray']:RemoveGas()

-- Set the pepper spray quantity for the player to 5
exports['r_pepperspray']:SetPepperQuantity(5)

-- Check if the player is gassed
local isGassed = exports['r_pepperspray']:IsGassed()

if isGassed then
    print("Player is gassed!")
else
    print("Player is not gassed.")
end
PreviousGeneral ConfigurationNextAnticheat

Last updated 1 month ago

🚿