Skip to content

Commit 4d269c0

Browse files
committed
Update v1.7.4
* Added MSK.Split
1 parent 9e7cf7c commit 4d269c0

File tree

4 files changed

+37
-2
lines changed

4 files changed

+37
-2
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.7.3
1+
1.7.4

client.lua

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ MSK.Trim = function(str, bool)
3131
return (str:gsub("%s+", ""))
3232
end
3333

34+
MSK.Split = function(str, delimiter)
35+
local result = {}
36+
37+
for match in (s..delimiter):gmatch("(.-)"..delimiter) do
38+
table.insert(result, match)
39+
end
40+
41+
return result
42+
end
43+
3444
MSK.Notification = function(message, info, duration, playSound)
3545
if Config.Notification == 'native' then
3646
SetNotificationTextEntry('STRING')
@@ -168,6 +178,21 @@ MSK.Comma = function(int, tag)
168178
return newInt
169179
end
170180

181+
MSK.GetVehicleInDirection = function()
182+
local playerPed = PlayerPedId()
183+
local playerCoords = GetEntityCoords(playerPed)
184+
local inDirection = GetOffsetFromEntityInWorldCoords(playerPed, 0.0, 5.0, 0.0)
185+
local rayHandle = StartExpensiveSynchronousShapeTestLosProbe(playerCoords, inDirection, 10, playerPed, 0)
186+
local numRayHandle, hit, endCoords, surfaceNormal, entityHit = GetShapeTestResult(rayHandle)
187+
188+
if hit == 1 and GetEntityType(entityHit) == 2 then
189+
local entityCoords = GetEntityCoords(entityHit)
190+
return entityHit, entityCoords
191+
end
192+
193+
return nil
194+
end
195+
171196
MSK.logging = function(script, code, ...)
172197
if code == 'error' then
173198
print(script, '[^1ERROR^0]', ...)

fxmanifest.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ games { 'gta5' }
44
author 'Musiker15 - MSK Scripts'
55
name 'msk_core'
66
description 'Core functions for MSK Scripts'
7-
version '1.7.3'
7+
version '1.7.4'
88

99
lua54 'yes'
1010

server.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ MSK.Trim = function(str, bool)
3939
return (str:gsub("%s+", ""))
4040
end
4141

42+
MSK.Split = function(str, delimiter)
43+
local result = {}
44+
45+
for match in (s..delimiter):gmatch("(.-)"..delimiter) do
46+
table.insert(result, match)
47+
end
48+
49+
return result
50+
end
51+
4252
MSK.RegisterCommand = function(name, group, cb, console, framework, suggestion)
4353
if type(name) == 'table' then
4454
for k, v in ipairs(name) do

0 commit comments

Comments
 (0)