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
π₯οΈ 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
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 ifplayer.joinequalstrue.
π 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