diff --git a/client/src/modules/AltModule.cpp b/client/src/modules/AltModule.cpp index d3d73435d..92e9b84ec 100644 --- a/client/src/modules/AltModule.cpp +++ b/client/src/modules/AltModule.cpp @@ -444,6 +444,45 @@ static void IsPointOnScreen(js::FunctionContext& ctx) ctx.Return(alt::ICore::Instance().IsPointOnScreen(point)); } +static void GetPoolSize(js::FunctionContext& ctx) +{ + if (!ctx.CheckArgCount(1)) return; + + std::string pool; + if (!ctx.GetArg(0, pool)) return; + + ctx.Return(alt::ICore::Instance().GetPoolSize(pool)); +} + +static void GetPoolCount(js::FunctionContext& ctx) +{ + if (!ctx.CheckArgCount(1)) return; + + std::string pool; + if (!ctx.GetArg(0, pool)) return; + + ctx.Return(alt::ICore::Instance().GetPoolCount(pool)); +} + +static void GetPoolEntities(js::FunctionContext& ctx) +{ + if (!ctx.CheckArgCount(1)) return; + + std::string pool; + if (!ctx.GetArg(0, pool)) return; + + auto entities = alt::ICore::Instance().GetPoolEntities(pool); + + js::Array arr(entities.size()); + for (auto entity : entities) + { + arr.Push(entity); + } + + ctx.Return(arr); +} + + // clang-format off extern js::Class playerClass, localPlayerClass, vehicleClass, pedClass, objectClass, audioClass, audioFilterClass, blipClass, markerClass, textLabelClass, checkpointClass, webViewClass, fontClass, @@ -508,6 +547,10 @@ static js::Module altModule("@altv/client", "@altv/shared", module.StaticFunction("getPedBonePos", GetPedBonePos); module.StaticFunction("isPointOnScreen", IsPointOnScreen); + module.StaticFunction("getPoolSize", GetPoolSize); + module.StaticFunction("getPoolCount", GetPoolCount); + module.StaticFunction("getPoolEntities", GetPoolEntities); + module.Namespace(eventsNamespace); module.Namespace(discordNamespace); module.Namespace(voiceNamespace); diff --git a/types/client/index.d.ts b/types/client/index.d.ts index fa34b8141..93200e352 100644 --- a/types/client/index.d.ts +++ b/types/client/index.d.ts @@ -55,6 +55,10 @@ declare module "@altv/client" { export function getPedBonePos(scriptId: number, boneId: number): altShared.Vector3; export function isPointOnScreen(pos: altShared.IVector3): boolean; + export function getPoolSize(pool: string): number; + export function getPoolCount(pool: string): number; + export function getPoolEntities(pool: string): Array; + export interface AudioCreateOptions { source: string; volume: number; @@ -127,7 +131,7 @@ declare module "@altv/client" { readonly hash: number; addRotateEffect(rate: number, priority: number): number; - addVolumeEffect(volume: number, priority: number): number; + addVolumeEffect(volume: number, priority: number, channel?: number): number; addPeakeqEffect(band: number, bandwidth: number, q: number, center: number, gain: number, priority: number): number; addDampEffect(target: number, quiet: number, rate: number, gain: number, delay: number, priority: number): number; addAutowahEffect(dryMix: number, wetMix: number, feedback: number, rate: number, range: number, freq: number, priority: number): number; diff --git a/types/client/package.json b/types/client/package.json index ddf11ddc5..8861d4887 100644 --- a/types/client/package.json +++ b/types/client/package.json @@ -1,6 +1,6 @@ { "name": "@altv/client", - "version": "0.0.11", + "version": "0.0.12", "description": "This package contains the type definitions for the alt:V JS module v2 client types", "types": "index.d.ts", "files": [