N.command β€” Server Commands

`N.command()` is the core function of NurJS, designed to make command creation in RAGE:MP extremely simple and powerful. With just one line of code, you can spawn vehicles, send notifications

🧭 Where It Works

Side
Availability
Description

πŸ–₯️ Server

βœ… Available

Used to register in-game text commands such as /garage, /ping, or /repair.

πŸ’» Client

❌ Not available

Client-side scripts cannot create commands.

πŸ”Ή Basic Example

N.command({
  cmd: "garage",
  description: "Spawn your vehicle instantly",
  adminOnly: false,
  createVehicle: { model: "sultan", color1: 0, color2: 0 },
  notify: "πŸš— Your car is ready!"
});

When a player types /garage, NurJS will automatically:

  • spawn a vehicle near the player,

  • show a notification,

  • log the action to the console.

βš™οΈ Parameters

Parameter
Type
Description

cmd

string

Command name without /. Required.

description

string

Short description for help or internal reference.

adminOnly

boolean / "off"

Restricts command to admins. NurJS checks player.admin === true. If false or "off", no restriction applies.

args

array

Defines how many arguments are expected. If not enough are passed, the hint will show.

hint

string

Shown to the player when not enough arguments are provided.

log

string / object / boolean

Enables console/file logging. Can log to file, text, or console.

checker

object

Checks player properties before running the command. Example: { join: true, prison: 0 } β†’ command runs only if player.join === true and player.prison === 0.

notify

string

Sends a notification message to the player.

createBlip

object

{ sprite, pos, name, color, shortRange } β€” creates a blip on the map.

createVehicle

object

{ model, pos, color, alpha, warpInto, engine, plate } β€” spawns a vehicle with options.

createObject

object

{ model, pos, rot, dimension } β€” creates a world object.

vehfix

boolean

If true, instantly repairs the player’s vehicle.

cooldown

number

Adds a cooldown (in seconds) before the command can be reused.

tp

array

[x, y, z] β€” teleports player to coordinates.

playAnim

object

{ dict, name } β€” plays animation.

playerScenario

string

Plays scenario (e.g. "WORLD_HUMAN_SMOKING").

weapon

object

{ model, ammo } β€” gives a weapon to the player.

playerAlpha

number

Sets player transparency (0–255).

tpToMarker

boolean

Teleports player to their map marker (client-side event).

tpToPlayer

boolean

Teleports player to another player (by ID or name).

tpPlayerToMe

boolean

Teleports another player to the command executor.

setWeather

string

Sets world weather ("EXTRASUNNY", "CLEAR", etc).

setTime

object

{ hour, minute } β€” sets the server time.

rangefreez

object

{ radius } β€” freezes all players in the specified radius.

safe

boolean

Runs your action in a try/catch block β€” prevents server crash if an error occurs.

action

function

The main logic of your command. Must be a function.

🧠 Advanced Example

βœ… If the player meets all the conditions, the command will execute. ❌ If not β€” NurJS will automatically stop the command and show a warning message.

πŸ”’ Admin & Checker Example

  • adminOnly: NurJS checks player.admin === true. If false β†’ denies execution.

  • checker: Each key/value pair is validated against the player object. Example: if { join: true }, the command only executes if player.join equals true.

πŸ” Cooldown Example

Prevents spamming β€” the player must wait 10 seconds before using /repair again.

🎯 Teleport Examples

πŸ”« Weapons & Animations

🧊 Freeze & Range Example

Freezes everyone within the radius specified in rangefreez.radius.

🧠 Safe Mode Example

Prevents server crash by catching internal command errors.

🧾 Logging Example

Saves custom log lines into /logs/announce.log.

N.command() is an all-in-one tool that unites scripting logic into a single system: teleports, weather, vehicles, logs, checks, cooldowns, animations, freezes β€” everything in one command.

Last updated