New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@infernus/distance

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@infernus/distance

A wrapper of the popular SA-MP distance library for samp-node.

latest
Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
9
125%
Maintainers
1
Weekly downloads
 
Created
Source

@infernus/distance

npm npm npm bundle size

A wrapper of the popular SA-MP distance library for samp-node.

Getting started

pnpm add @infernus/core @infernus/distance

Example

import { Player, PlayerEvent } from "@infernus/core";
import {
  getClosestVehicleToPlayer,
  isPlayerInRangeOfPlayer,
  isPlayerInRangeOfVehicle,
} from "@infernus/distance";

PlayerEvent.onCommandText("pay", ({ player, subcommand, next }) => {
  const [playerId2, amount] = subcommand;
  if (!playerId2 || !amount) {
    return player.sendClientMessage(
      -1,
      "USAGE: /pay <Player name/ID> <Amount>",
    );
  }

  const player2 = Player.getInstance(+playerId2);

  if (!player2 || !isPlayerInRangeOfPlayer(player, player2, 5.0)) {
    return player.sendClientMessage(
      0xff0000ff,
      "The specified player is not near you!",
    );
  }

  player.giveMoney(-amount);
  player2.giveMoney(+amount);
  return next();
});

PlayerEvent.onCommandText("fixtires", ({ player, next }) => {
  const vehicle = getClosestVehicleToPlayer(player);

  if (!vehicle || !isPlayerInRangeOfVehicle(player, vehicle, 10.0)) {
    return player.sendClientMessage(
      0xff0000ff,
      "You are not near any vehicle!",
    );
  }

  const { panels, doors, lights } = vehicle.getDamageStatus();
  vehicle.updateDamageStatus(panels, doors, lights, 0);
  return next();
});

Keywords

samp

FAQs

Package last updated on 28 Jan 2026

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