LC-Development
  • 👋Welcome to HapticCode
  • 📚Library
    • 🖥️Haptic-Lib
      • 🔧 Config
      • 📙 Usage
      • 🤝Client Functions
        • Blips
        • Items
        • Notify
        • Target
        • Peds
      • 💻Server Functions
        • Items
        • Jobs
        • Money Functions
        • Notify
  • 😇Remastered Scripts
    • 🛒 LC-Businesses
      • 🎯Job Blips
      • 💼 Duty Locations
      • ❄️ Fridges
        • Fridge Shops
        • Fridge Stashs
        • Final Step
      • 📥 Trays
      • 🍔 Drink/Fryer/Grill/Pack
      • 📦Shared Employee Stash
      • 📦Private Employee Stash
      • 📦Table Stashs
      • 🪑 Chairs
      • 💃 NPC Dancers/Strippers
      • 🎧 DJ Booths
      • 💰Cash Registers
      • 🧑Custom Animations
      • 🍔Consumables
    • 🏛️LC-Cityhall
      • 📝Config
      • 💳Licenses
  • Haptic
    • 😷 Haptic-Gangs
      • 🔧 Initial Config
      • 📚 Zone Configuration
      • 💊Drug Dealing
        • 💊 Zone Based Dealing
      • 💀Death Tracker
      • 💻Exports
      • 📝 Integrations
        • 🚑 QB-AmbulanceJob
        • 💎 QB-Jewellery
        • 💵 QB-StoreRobbery
        • 💦Rcore Integration
      • 🏗️Common Issues
    • 🔫Haptic-Ammunation
      • 📝Config
    • 💊Haptic-DrugEffects
Powered by GitBook
On this page
  1. Library
  2. Haptic-Lib
  3. 🤝Client Functions

Blips

HapticLib provides self cleaning blips and its extremely easy to use. Rather than generating each blip manually in your script. You can use the lib

Previous Blip Generation Example

if v.blip_enabled then
     local blip = AddBlipForCoord(v.blip_location)
     SetBlipAsShortRange(blip, true)
     SetBlipSprite(blip, v.blip_sprite)
     SetBlipScale(blip, v.blip_scale)
     SetBlipDisplay(blip, 6)
     BeginTextCommandSetBlipName('STRING')
     AddTextComponentString(v.blip_name)
     EndTextCommandSetBlipName(blip)
end

You can pass the same parameters to the Lib and not have to worry about cleaning up blips.

-- Function
HapticLib.CreateBlip(uniqueid, coords, shortrange, sprite, scale, name, color)

-- Usage
-- You always want to parse a uniqueid to the library so that it can clean up
local uniqueid = "Cityhall_" .. HapticLib.GenerateString(4)
HapticLib.CreateBlip(uniqueid, v.blip_location, v.blip_shortrange, v.blip_sprite, v.blip_scale, v.blip_name, v.blip_color)

To Remove a blip in runtime you can also do.

HapticLib.RemoveBlip(UniqueID) -- This is why setting uniqueid's is important
Previous🤝Client FunctionsNextItems

Last updated 1 year ago

📚
🖥️