MSK Scripts
TebexGithubDiscordMusiker15
  • MSK Scripts
    • Welcome
  • Common Issues
    • Keymaster
  • Miscellaneous
    • Change Notifications
  • Scripts
    • MSK Core
      • Installation
      • Functions
        • Client
          • Ace Permission
          • Commands
          • Coords
          • Player
          • Points
          • Request
          • Scaleform
          • UI
            • Input
            • Numpad
            • Progressbar
            • TextUI
          • Vehicle
        • Shared
          • String
          • Math
          • Table
          • Timeout
          • Vector
        • Server
          • Ace Permission
          • Ban System
          • Commands
          • Player
          • Scaleform
          • UI
            • Input
            • Numpad
            • Progressbar
            • TextUI
    • MSK Banking
      • Installation
        • Paycheck Transaction
      • Config
      • Exports
        • Client
        • Server
      • Events
        • Client
        • Server
      • Server Callbacks
    • MSK EngineToggle
      • Guides
      • Exports
        • Client
      • Event Handler
        • Client
        • Server
    • MSK Fuel
      • Config
      • Exports
        • Client
    • MSK Garage
      • Config
      • Exports
        • Client
    • MSK Handcuffs
      • Guides
        • General Edits for Jobs
        • Jaksam Job Creator
        • Multichar
        • ox_inventory
      • Config
      • Admin Commands
      • Exports
        • Client
        • Server
      • Events
        • Client
        • Server
      • Event Handlers
    • MSK Radio
      • Config
      • Exports
        • Client
        • Server
      • Events
        • Server
    • MSK Simcard
      • Installation
        • Config.Database
      • Config
    • MSK VehicleKeys
      • Guides
        • Installation
        • Integrations
      • Config
      • Admin Commands
      • Exports
        • Client
        • Server
    • MSK Whitelist
      • Config
      • Exports
        • Client
        • Server
    • MSK Weaponammo
Powered by GitBook
On this page
  • MSK.CoordsToString
  • MSK.VectorToVector
  • MSK.TableToVector
  1. Scripts
  2. MSK Core
  3. Functions
  4. Shared

Vector

MSK.CoordsToString

Converts the given coords to a vector string

Parameters coords - vector3, vector4 or table - Coordinates

Returns vectorString - string - the given coordinates as a string

local vectorString = MSK.CoordsToString(coords)

-- Example
local vectorString = MSK.CoordsToString(GetEntityCoords(PlayerPedId()))

MSK.VectorToVector

Converts vector4 to vector3

Parameters coords - vector4 - vector4 coordinates

Returns coords - vector3 - the given vector4 coordinates as vector3

local vec3Coords = MSK.VectorToVector(vector4)

-- Example
local vec3Coords = MSK.VectorToVector(vector4(0.0, 0.0, 0.0, 0.0))

print(MSK.CoordsToString(vec3Coords)) -- Output: "vector3(0.0, 0.0, 0.0)"

MSK.TableToVector

Converts a table to vector

Parameters coords - table - table coordinates

Returns coords - vector3 or vector4 - the given table coordinates as vector3 or vector4

local vecCoords = MSK.TableToVector(tableCoords)

-- Example 1: vector3
local vec3Coords = MSK.TableToVector({x = 0.0, y = 0.0, z = 0.0})

-- Example 2: vector4
local vec4Coords = MSK.TableToVector({x = 0.0, y = 0.0, z = 0.0, h = 0.0})

Last updated 6 months ago