Skip to content

Commit 560bbef

Browse files
committed
Update v2.6.3
1 parent bdfc060 commit 560bbef

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

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 'Functions for MSK Scripts'
7-
version '2.6.2'
7+
version '2.6.3'
88

99
lua54 'yes'
1010

server/functions/ace.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@ MSK.IsAceAllowed = function(playerId, command)
33
end
44
exports('IsAceAllowed', MSK.IsAceAllowed)
55

6-
MSK.IsPrincipalAceAllowed = function(restricted, ace)
7-
return IsPrincipalAceAllowed(restricted, ace)
6+
MSK.IsPrincipalAceAllowed = function(principal, ace)
7+
if not MSK.String.StartsWith(principal, 'group.') and not MSK.String.StartsWith(principal, 'player.') then
8+
if type(principal) == 'string' then
9+
principal = 'group.'..principal
10+
elseif tonumber(principal) then
11+
principal = 'player.'..tostring(principal)
12+
end
13+
end
14+
15+
return IsPrincipalAceAllowed(principal, ace)
816
end
917
exports('IsPrincipalAceAllowed', MSK.IsPrincipalAceAllowed)
1018

server/functions/commands.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ MSK.RegisterCommand = function(commandName, callback, properties, ...)
139139
if restricted then
140140
local ace = ('command.%s'):format(commandName)
141141

142-
if type(restricted) == 'string' and not IsPrincipalAceAllowed(restricted, ace) then
142+
if type(restricted) == 'string' and not MSK.IsPrincipalAceAllowed(restricted, ace) then
143143
MSK.AddAce(restricted, ace)
144144
elseif type(restricted) == 'table' then
145145
for i = 1, #restricted do
146146
local res = restricted[i]
147147

148-
if not IsPrincipalAceAllowed(res, ace) then
148+
if not MSK.IsPrincipalAceAllowed(res, ace) then
149149
MSK.AddAce(res, ace)
150150
end
151151
end

0 commit comments

Comments
 (0)