You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@wdesgardin/fivem-js

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wdesgardin/fivem-js

Javascript/Typescript wrapper for the FiveM natives

1.6.13
latest
Source
npmnpm
Version published
Weekly downloads
41
-28.07%
Maintainers
0
Weekly downloads
 
Created
Source

fivem-js

:fire: A Javascript/Typescript wrapper for the FiveM natives :video_game:

License: MIT npm version Github master branch state Last commit

Documentation

Functionality of this wrapper is based on the FiveM C# wrapper - link. It's a feature-rich set of helper classes, objects, and functions to help you develop your project faster.

This library was originally created by d0p3t.

Features

  • One dependency @citizenfx/client
  • Abstracts common used FiveM practices
  • Entity management through class objects (i.e. Vehicle and Ped entities)
  • UI elements such as scaleforms and loading prompts
  • Audio, Blips, Cameras and more...

In other words, whatever the FiveM C# wrapper can do, this package can as well and more!

Download & Install

npm install @wdesgardin/fivem-js

Simple Usage

See here for example projects.

Typescript

import * as Cfx from 'fivem-js';

RegisterCommand(
  'adder',
  async (source: number, args: string[]) => {
    const vehicle = await Cfx.World.createVehicle(
      new Cfx.Model('adder'),
      new Cfx.Vector3(1, 2, 3),
      4,
    );
    Cfx.Game.PlayerPed.setIntoVehicle(vehicle, Cfx.VehicleSeat.Driver);
  },
  false,
);

You can also individually import classes.

import { World } from 'fivem-js/lib/World';

Javascript

/// <reference path="node_modules/fivem-js/lib/index.d.ts"/>
/// <reference path="node_modules/@citizenfx/client/natives_universal.d.ts"/>

const Cfx = require('fivem-js');

RegisterCommand(
  'adder',
  async (source, args) => {
    const vehicle = await Cfx.World.createVehicle(
      new Cfx.Model('adder'),
      new Cfx.Vector3(1, 2, 3),
      4,
    );
    Cfx.Game.PlayerPed.setIntoVehicle(vehicle, Cfx.VehicleSeat.Driver);
  },
  false,
);

Contributing

You are more than welcome to contribute to this project by submitting a pull request and creating issues.

Please checkout CONTRIBUTING.md for our contributing guidelines.

License

MIT with customization. See LICENSE

Keywords

fivem

FAQs

Package last updated on 01 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts