Mads' Resource Documentation
  • 📺Youtube
  • 🤝Discord
  • ⭐Tebex
  • 👨‍💻GitHub
  • 👋Welcome!
  • General Info
    • ❓Questions and Answers
      • Is X script locked/encrypted?
      • I need support, where can I reach out?
      • How do I update my server artifacts?
      • How do I transfer a script from one account to another?
      • How do I set my game build?
    • ⚠️Common Problems
      • You lack the required entitlement
      • Failed to verify protected resource
      • Could not find dependency /assetpacks for resource
  • Resources
    • 🪑Sit Anywhere
      • Adding Custom Models
      • Falling Through the Map
      • Exports
      • Events
    • 🚁Helicopter Camera
      • Adding custom helicopters
      • Moving the UI above the minimap
      • Adding controller inputs
      • Controls
      • Exports
      • Events
    • 🚙Slash Tires
      • Exports
      • Events
    • 🕶️Stungrenade
      • Adding the Stungrenade as an item
      • Measures Against Cheaters
      • Exports
      • Events
    • 🪖CS Styled Killfeed
      • General Information
      • Exports - Client Side
      • Exports - Server Side
      • Examples
      • Adding Messages to the feed
      • Weapons List / Death Reasons
      • Changing the position if the killfeed
    • Crouch & Crawl
      • Exports
    • 🔫Taser Effect
    • 🔭Telescopes
    • 🩺Crutches
      • How to make the script compatible with ps-walkstyle
    • ⛽No Exploding Pumps
    • 👠Hookers
Powered by GitBook
On this page
  • Client
  • Examples
  • Server
  • Examples
  1. Resources
  2. Slash Tires

Events

Client

There is primarily one event that the script emits for other scripts to listen to, more can be added if requested. The event's name is slashtires:slashedTire, it has 2 parameters, vehicle (a vehicle handle), and tireIndex.

Examples

-- This event is fired when the local player has slashed a tire
AddEventHandler('slashtires:slashedTire', function(vehicle, tireIndex)
    print(string.format("Local player slashed a tire (index: %s) of vehicle %s", tireIndex, vehicle))
end)

Server

There is also one event on the server, it has the same name, but it's NOT a net event, it is emitted from the server to the server. In contrast to the client version, this event contains much more data, the data in this event should in principle be trustable, as most of the data has been collected on the server, and not by the client. The following is the data table included with the event:

{
    source = src, -- string
    netId = netId, -- integer
    tireIndex = tireIndex, -- integer
    hasBurstedTire = hasBurstedTire, -- boolean: if the tire was burst on the client, or if the server needed to send a event to another client to make it burst
    vehicleCoords = vehicleCoords, -- vector3
    playerCoords = playerCoords, -- vector3
    distance = distance, -- number
    weaponHash = weaponHash, -- integer
    weaponName = weaponName, -- string
    sendtAlert = sendtAlert, -- boolean
    weaponRemoved = wasWeaponRemoved, -- boolean
    vehicleModel = vehicleModel, -- integer
    numberPlate = numberPlate -- string
}

Examples

-- This event is fired when a player has successfully slashed a tire
AddEventHandler('slashtires:slashedTire', function(data)
    print(json.encode(data, {indent = true}))
end)
PreviousExportsNextStungrenade

Last updated 11 months ago

🚙