Git Product home page Git Product logo

pmc-callbacks's Introduction

PMC-CALLBACKS SYSTEM

Installation [EN]

  • Download the latest version of pmc-callbacks
  • Unzip the file and add to your resources folder pmc-callbacks
  • Add to your .cfg file ensure pmc-callbacks

Usage [EN]

  • Add to your fxmanifest resource file shared_script '@pmc-callbacks/import.lua'

Instalación [ES]

  • Descarga la última versión de pmc-callbacks
  • Descomprime el archivo y añade a tu carpeta resources pmc-callbacks
  • Añade a tu archivo .cfg ensure pmc-callbacks

Uso [ES]

  • Añade a tu archivo fxmanifest shared_script '@pmc-callbacks/import.lua'

Methods / Métodos

server-side
global function params return
RegisterServerCallback eventName string | callback function nil
TriggerClientCallback target number | eventName string | *args any any
client-side
global function params return
RegisterClientCallback eventName string | callback function nil
TriggerServerCallback eventName string | *args any any

Example / Ejemplo

client-side
RegisterCommand('requestserver', function(s, args)
    local result = TriggerServerCallback('pmc-test:testingAwesomeCallback')
    print('gotcha', result)
end)

RegisterClientCallback('pmc-test:requestSomething', function(...)
    -- stuff code
    return true -- return any
end)
server-side
RegisterServerCallback('pmc-test:testingAwesomeCallback', function(source, ...)
    -- stuff code
    return true -- return any
end)

RegisterCommand('requestclient', function(s, args)
    local target = tonumber(args[1])
    local result = TriggerClientCallback(target, 'pmc-test:requestSomething')
    print('gotcha', result)
end)

pmc-callbacks's People

Contributors

pitermcflebor avatar

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.