568
568
addEvent ( " aTeam" , true )
569
569
addEventHandler ( " aTeam" , _root , function ( action , name , r , g , b )
570
570
if checkClient ( " command." .. action , source , ' aTeam' , action ) then return end
571
- if ( hasObjectPermissionTo ( source , " command." .. action ) ) then
571
+ if ( hasObjectPermissionTo ( client or source , " command." .. action ) ) then
572
572
mdata = tostring ( data )
573
573
mdata = " "
574
574
if ( action == " createteam" ) then
@@ -878,7 +878,7 @@ addEventHandler ( "aPlayer", _root, function ( player, action, data, additional,
878
878
if not isElement ( player ) then
879
879
return -- Ignore if player is no longer valid
880
880
end
881
- if ( hasObjectPermissionTo ( source , " command." .. action ) ) then
881
+ if ( hasObjectPermissionTo ( client or source , " command." .. action ) ) then
882
882
local admin = source
883
883
local mdata = " "
884
884
local more = " "
@@ -1187,7 +1187,7 @@ end
1187
1187
addEvent ( " aVehicle" , true )
1188
1188
addEventHandler ( " aVehicle" , _root , function ( player , action , data )
1189
1189
if checkClient ( " command." .. action , source , ' aVehicle' , action ) then return end
1190
- if ( hasObjectPermissionTo ( source , " command." .. action ) ) then
1190
+ if ( hasObjectPermissionTo ( client or source , " command." .. action ) ) then
1191
1191
if ( not player ) then return end
1192
1192
local vehicle = getPedOccupiedVehicle ( player )
1193
1193
if ( vehicle ) then
@@ -1271,7 +1271,7 @@ addEvent ( "aResource", true )
1271
1271
addEventHandler ( " aResource" , _root , function ( name , action )
1272
1272
if checkClient ( " command." .. action , source , ' aResource' , action ) then return end
1273
1273
local pname = getPlayerName ( source )
1274
- if ( hasObjectPermissionTo ( source , " command." .. action ) ) then
1274
+ if ( hasObjectPermissionTo ( client or source , " command." .. action ) ) then
1275
1275
local text = " "
1276
1276
if ( action == " start" ) then if ( startResource ( getResourceFromName ( name ), true ) ) then text = " started" end
1277
1277
elseif ( action == " restart" ) then
@@ -1298,7 +1298,7 @@ end )
1298
1298
addEvent ( " aServer" , true )
1299
1299
addEventHandler ( " aServer" , _root , function ( action , data , data2 )
1300
1300
if checkClient ( " command." .. action , source , ' aServer' , action ) then return end
1301
- if ( hasObjectPermissionTo ( source , " command." .. action ) ) then
1301
+ if ( hasObjectPermissionTo ( client or source , " command." .. action ) ) then
1302
1302
local mdata = tostring ( data )
1303
1303
local mdata2 = " "
1304
1304
if ( action == " setgame" ) then
@@ -1452,7 +1452,7 @@ addEventHandler ( "aMessage", _root, function ( action, data )
1452
1452
table.remove ( aReports , 1 )
1453
1453
end
1454
1454
end
1455
- if ( hasObjectPermissionTo ( source , " general.adminpanel" ) ) then
1455
+ if ( hasObjectPermissionTo ( client or source , " general.adminpanel" ) ) then
1456
1456
if ( action == " get" ) then
1457
1457
triggerClientEvent ( source , " aMessage" , source , " get" , aReports )
1458
1458
elseif ( action == " read" ) then
@@ -1487,7 +1487,7 @@ end )
1487
1487
addEvent ( " aBans" , true )
1488
1488
addEventHandler ( " aBans" , _root , function ( action , data , arg1 , arg2 , arg3 )
1489
1489
if checkClient ( " command." .. action , source , ' aBans' , action ) then return end
1490
- if ( hasObjectPermissionTo ( source , " command." .. action ) ) then
1490
+ if ( hasObjectPermissionTo ( client or source , " command." .. action ) ) then
1491
1491
local mdata = " "
1492
1492
local more = " "
1493
1493
if ( action == " banip" ) then
@@ -1548,7 +1548,7 @@ end )
1548
1548
addEvent ( " aExecute" , true )
1549
1549
addEventHandler ( " aExecute" , _root , function ( action , echo )
1550
1550
if checkClient ( " command.execute" , source , ' aExecute' , action ) then return end
1551
- if ( hasObjectPermissionTo ( source , " command.execute" ) ) then
1551
+ if ( hasObjectPermissionTo ( client or source , " command.execute" ) ) then
1552
1552
local result = loadstring (" return " .. action )()
1553
1553
if ( echo == true ) then
1554
1554
local restring = " "
0 commit comments