Player::callProc
Server-Side Function
This function calls the specified player's clientside and expects a callback.
JavaScript Syntax
Syntax
player.callProc('eventProcName', [...args]);
Required Arguments
- *eventProcName: String
- args: Any
Example
Server-Side
(async () => {
try {
let res = await player.callProc('test_proc', ['ok']);
console.log('succ', res);
} catch(e) {
console.error('Error: ' + e);
}
}();
Client-Side
mp.events.addProc('test_proc', (player, text) => {
return 'hey beast: ' + text;
});