players.setSkin
Changes the character model a player appears as, for everyone. A seated player keeps their vehicle, seat and seated animation when the skin changes. An entry or exit animation already in progress also continues after the change.
Signature
Section titled “Signature”players.setSkin(player: PlayerTarget, skinModel: number): Promise<ActionResult>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
player |
PlayerTarget |
The player, or their ID. |
skinModel |
number |
GTA:SA’s ped model ID, 0 to 311; all of them on Skins. |
Returns
Section titled “Returns”A promise of an ActionResult: applied once the player’s game has carried it out, rejected with a code, or timeout after five seconds without an answer.
Example
Section titled “Example”A /skin command.
import { chat, commands, players } from "nativemp";
commands.register("skin", async (player, args) => { const result = await players.setSkin(player, Number(args)); if (result.status === "rejected") chat.sendServerMessage(`That skin didn't work (${result.code}).`, player);});Related
Section titled “Related”players.spawn: choose the skin at spawn
A captured Player keeps this effect bound to its connection across awaits; see Async handlers.