dockfries / infernus

Node.js library for scripting Open Multiplayer.
https://dockfries.github.io/infernus/
MIT License
21 stars 2 forks source link

Broken setSkin, getArmour and getHealth player methods. #39

Closed Frank441 closed 4 months ago

Frank441 commented 4 months ago

Using players methods like setSkin(), getArmour() or setSkin(skinId) will result in an error.

Example code:

import { PlayerEvent } from "@infernus/core";

PlayerEvent.onCommandText(["health"], async ({ player, subcommand, next }) => {
    player.sendClientMessage(-1, `Your health is ${player.getHealth()}.`);
    return next();
});

PlayerEvent.onCommandText(["kevlar", "armour"], async ({ player, subcommand, next }) => {
    player.sendClientMessage(-1, `Your armour is ${player.getArmour()}.`);
    return next();
});

PlayerEvent.onCommandText(["setskin"], async ({ player, subcommand, next }) => {
    player.setSkin(+subcommand[0] || 1);
    return next();
});

Received error:

WARN: number 100 is not iterable (cannot read property Symbol(Symbol.iterator))

Dependencies:

dockfries commented 4 months ago

use my samp-node fork instead of iAmir's.