@vrpjs0.5/server
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

Big Thanks to Marmota for giving me the necessary files to convert it

@vrpjs0.5/server

A bridge for using FiveM vRP 0.5 in JavaScript.

Installation

It is done via the npm install command:

npm install @vrpjs0.5/server

Usage

const { VrpProxy, VrpTunnel } = require('@vrpjs0.5/server');

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

on('vRP:playerSpawn', async (userId, player, firstSpawn) => {
    if (firstSpawn) {
        vRP.request(player, 'Do you want money?', 20, async (v,ok)  =>{
        if (ok){
            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~!`);
        }
    })
    }
});

Package Sidebar

Install

npm i @vrpjs0.5/server

Weekly Downloads

1

Version

1.0.8

License

MIT

Unpacked Size

10.3 kB

Total Files

11

Last publish

Collaborators

  • xonlyfadi