Git Product home page Git Product logo

redm-events's Introduction

redm-events

A script to simplify the use of events in RedM.
Probably a "developer resource".
Documentation will remain vague, read the code for more information.

Usage

You can either use the exports as-needed (don't use per-frame due to export performance hit) or reference the api directly through your resources fxmanifest.lua, e.g:

-- fxmanifest.lua
fx_version 'adamant'
game 'rdr3'
rdr3_warning 'I acknowledge that this is a prerelease build of RedM, and I am aware my resources *will* become incompatible once RedM ships.'

client_scripts {
  '@redm-events/dataview.lua',
  '@redm-events/events.lua',
  'main.lua'
}

Example of use:

-- with api reference as shown above:
Citizen.CreateThread(function()
  while true do
    local isLooting = events.getEventData("EVENT_LOOT_COMPLETE")
    if isLooting then
      print(isLooting["Looted entity id"],isLooting[2]) -- > 30481234 30481234
    end

    Wait(0)
  end
end)

-- with exports:
Citizen.CreateThread(function()
  local isLooting = exports['redm-events']:getEventData("EVENT_LOOT_COMPLETE")
  if isLooting then
    print(isLooting["Looted entity id"],isLooting[2]) -- > 30481234 30481234
  end
end)

Credits

GottfriedLeibniz, for the dataview.lua script.
femga, for the rdr3_dicoveries repository.

redm-events's People

Contributors

meta-hub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

redm-events's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.