1.0.4 • Published 3 years ago

@vrpjs/server v1.0.4

Weekly downloads
6
License
MIT
Repository
github
Last release
3 years ago

@vrpjs/server

A bridge for using FiveM vRP 1.0 in JavaScript.

Installation

It is done via the npm install command:

npm install @vrpjs/server

Usage

const { VrpProxy, VrpTunnel } = require('@vrpjs/server');

const vRP = VrpProxy.getInterface('vRP');
const vRPClient = VrpTunnel.getInterface('vRP');

on('vRP:playerSpawn', async (userId, player, firstSpawn) => {
    if (firstSpawn) {
        if (await vRP.request(player, 'Do you want money?', 20)) {
            vRP.giveMoney(userId, 1000);
            vRPClient._notify(player, `You now have ~g~$${vRP.getMoney(userId)}!`);
        } else {
            const position = await vRPClient.getPosition(player);
            vRPClient._notify(player, `You recused money at ~b~${position.join('~s~, ~b~')}~s~!`);
        }
    }
});
1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago