-
Notifications
You must be signed in to change notification settings - Fork 2
Groups
dev2alert edited this page Feb 4, 2022
·
1 revision
Home ▸ Groups
Group is an array that allows you to group Object, TextDraw, and many other elements.
The group has the functions create
, destroy
, show
and hide
, thanks to which you can perform actions on elements.
Creating and displaying TextDraw:
import {GameMode, Group, Player, TextDraw} from "@sa-mp/core";
const textdraws: Group<TextDraw> = new Group(
new TextDraw({text: "Text #1!", x: 300, y: 100, color: 0xf2630aAA}),
new TextDraw({text: "Text #2!", x: 300, y: 150, color: 0xf2630aAA}),
new TextDraw({text: "Text #3!", x: 300, y: 200, color: 0xf2630aAA}),
new TextDraw({text: "Text #4!", x: 300, y: 250, color: 0xf2630aAA}),
new TextDraw({text: "Text #5!", x: 300, y: 300, color: 0xf2630aAA})
);
GameMode.on("init", () => textdraws.create());
Player.on("connect", (player) => textdraws.show(player));
- Getting started [RU]
- Configuration [RU]
- Command line interface (CLI) [RU]
- Examples [RU]
- Player commands [RU]
- Keyboard [RU]
- Dialogs [RU]
- Groups [RU]
- Context API [RU]
- AMX API [RU]