Difference between revisions of "Browser::callProc"

From RAGE Multiplayer Wiki
Jump to navigation Jump to search
(Created page with "This function calls registered Remote Prodecure Call (RPC) from browser to client-side and expects a callback. __TOC__ <br/> {{JSContainer| == Syntax == <pre> mp.events.callP...")
 
(No difference)

Latest revision as of 12:00, 25 June 2020

This function calls registered Remote Prodecure Call (RPC) from browser to client-side and expects a callback.


JavaScript Syntax
Jslogo.png

Syntax

mp.events.callProc('eventProcName', args);

Required Arguments

  • *eventProcName: String
  • args: Any

Examples

// calls 'test_proc' from client-side
mp.events.callProc('test_proc', 'test');


Client-Side
mp.events.addProc('test_proc', (text) => {
  mp.gui.chat.push('data: ' + text);
});