players.setSkill
Sets one of a player’s skills, 0 to 1000. Every player starts at 1000 in all of them. A weapon skill also changes how the other players see that player hold, aim and dual-wield the weapon.
Signature
Section titled “Signature”players.setSkill(player: PlayerTarget, skill: PlayerSkill, level: number): Promise<ActionResult>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
player |
PlayerTarget |
The player, or their ID. |
skill |
PlayerSkill |
Which skill; see Skills. |
level |
number |
0 to 1000. |
Returns
Section titled “Returns”A promise of an ActionResult: applied once the server has set it, rejected with a code.
Skills
Section titled “Skills”PlayerSkill names GTA:SA’s skill stats. The game keeps no boat skill.
PlayerSkill |
GTA:SA stat | What it does |
|---|---|---|
pistol |
69 | Pistol: at 1000, two at once. |
silencedPistol |
70 | Silenced pistol. |
desertEagle |
71 | Desert Eagle. |
shotgun |
72 | Shotgun. |
sawnoff |
73 | Sawn-off shotgun: at 1000, two at once. |
combatShotgun |
74 | Combat shotgun. |
machinePistol |
75 | Uzi and Tec-9: at 1000, two at once. |
mp5 |
76 | MP5. |
ak47 |
77 | AK-47. |
m4 |
78 | M4. |
rifle |
79 | Country rifle and sniper rifle. |
stamina |
22 | How long the player can sprint and swim fast. |
driving |
160 | Car handling. |
flying |
223 | Aircraft handling; at 180 or more an airport gate opens from outside. |
lungCapacity |
225 | How long the player can stay under water. |
bike |
229 | Motorbike handling, and how easily the player falls off. |
cycling |
230 | Bicycle handling and bunny hops. |
gambling |
81 | Casino bets: the higher, the bigger the bets. |
Example
Section titled “Example”Everyone starts as a beginner with an MP5.
import { players, server, PlayerSkill } from "nativemp";
server.on("playerConnected", async ({ player }) => { await players.setSkill(player, PlayerSkill.mp5, 0);});Related
Section titled “Related”players.giveWeapon: the weapon itselfgateOpenRequest: the airport gates read the flying skill
A captured Player keeps this effect bound to its connection across awaits; see Async handlers.