🤖Functions

Here you can find some details about extra functions our API provides


Notifications

There are three available types ("success", "warning", "error").

-- VortexAPI.AddNotification(text, timeout, type);
VortexAPI.AddNotification("Text", 2000, "success")

Utilities

-- returns the users name
VortexAPI.GetUsername()

World to Screen

If the position is invalid/off screenret will be false.

-- returns the screen pos of a world pos (vector3)
local ret, x, y = VortexAPI.WorldToScreen(coords)

Custom User Input

-- opens a keyboard input prompt and returns the entered string
VortexAPI.OpenKeyboardInput("inputId", "Header", 20, function(enteredString)
end)

Camera

-- hit, endCoords, entity
VortexAPI.RaycastCamera()

-- hit, endCoords, entity
VortexAPI.RaycastGameplayCamera()

Models

If timeoutisn't set a default of 5000ms will be used.

-- will request a model and perform a basic validity check
local hasLoaded = VortexAPI.RequestModel(hash, timeout)

Network Control

Only works for a few servers.

-- will request control of an entity
local gotControl = VortexAPI.RequestControl(entity, maxTrys)

Spawning

These functions will only return a handle to the spawned entity if returnHandle is true!

If you don't need a handle to the entity you should set returnHandle to false!

-- spawn object
local object = VortexAPI.CreateObject(returnHandle, modelHash, x, y, z)

-- spawn vehicle
local vehicle = VortexAPI.CreateVehicle(returnHandle, modelHash, x, y, z, heading)

-- spawn ped
local ped = VortexAPI.CreatePed(returnHandle, pedType, modelHash, x, y, z, heading)

Keys

Use the key indexes from the microsoft api.

-- checks if a key is pressed
VortexAPI.IsKeyPressed(virtualKeyIndex)

-- checks if a key was just pressed
VortexAPI.IsKeyJustPressed(virtualKeyIndex)

-- presses a key with delay
VortexAPI.KeyPress(virtualKeyIndex, delay)

Last updated