@@ -53,7 +53,7 @@ function aHandleIP2CUpdate()
5353
5454 for playerID = 1 , # playersTable do
5555 local playerElement = playersTable [playerID ]
56- local hasAdminPermission = hasObjectPermissionTo (playerElement , " general.adminpanel" )
56+ local hasAdminPermission = hasObjectPermissionTo (playerElement , " general.adminpanel" , false )
5757
5858 if hasAdminPermission then
5959
@@ -89,7 +89,7 @@ addEventHandler ( "onResourceStart", root, function ( resource )
8989 if ( resource ~= getThisResource () ) then
9090 local resourceName = getResourceName (resource )
9191 for id , player in ipairs (getElementsByType (" player" )) do
92- if ( hasObjectPermissionTo ( player , " general.tab_resources" ) ) then
92+ if ( hasObjectPermissionTo ( player , " general.tab_resources" , false ) ) then
9393 triggerClientEvent ( player , " aClientResourceStart" , root , resourceName )
9494 end
9595 end
@@ -107,7 +107,7 @@ addEventHandler ( "onResourceStart", root, function ( resource )
107107 aSetupCommands ()
108108 for id , player in ipairs ( getElementsByType ( " player" ) ) do
109109 aPlayerInitialize ( player )
110- if ( hasObjectPermissionTo ( player , " general.adminpanel" ) ) then
110+ if ( hasObjectPermissionTo ( player , " general.adminpanel" , false ) ) then
111111 notifyPlayerLoggedIn (player )
112112 end
113113 end
@@ -257,7 +257,7 @@ addEventHandler ( "onResourceStop", root, function ( resource )
257257 if ( resource ~= getThisResource () ) then
258258 local resourceName = getResourceName (resource )
259259 for id , player in ipairs (getElementsByType (" player" )) do
260- if ( hasObjectPermissionTo ( player , " general.tab_resources" ) ) then
260+ if ( hasObjectPermissionTo ( player , " general.tab_resources" , false ) ) then
261261 triggerClientEvent ( player , " aClientResourceStop" , root , resourceName )
262262 end
263263 end
@@ -431,8 +431,8 @@ addEventHandler ( "onPlayerJoin", root, function ()
431431 end
432432 aPlayerInitialize ( source )
433433 for id , player in ipairs (getElementsByType (" player" )) do
434- if ( hasObjectPermissionTo ( player , " general.adminpanel" ) ) then
435- triggerClientEvent ( player , " aClientPlayerJoin" , source , getPlayerIP ( source ), getPlayerAccountName ( source ), getPlayerSerial ( source ), hasObjectPermissionTo ( source , " general.adminpanel" ), aPlayers [source ][" country" ] )
434+ if ( hasObjectPermissionTo ( player , " general.adminpanel" , false ) ) then
435+ triggerClientEvent ( player , " aClientPlayerJoin" , source , getPlayerIP ( source ), getPlayerAccountName ( source ), getPlayerSerial ( source ), hasObjectPermissionTo ( source , " general.adminpanel" , false ), aPlayers [source ][" country" ] )
436436 end
437437 end
438438 setPedGravity ( source , getGravity () )
@@ -512,7 +512,7 @@ function aPlayerSerialCheck ( player, result )
512512end
513513
514514addEventHandler ( " onPlayerLogin" , root , function ( previous , account , auto )
515- if ( hasObjectPermissionTo ( source , " general.adminpanel" ) ) then
515+ if ( hasObjectPermissionTo ( source , " general.adminpanel" , false ) ) then
516516 triggerEvent ( " aPermissions" , source )
517517 notifyPlayerLoggedIn ( source )
518518 end
@@ -545,7 +545,7 @@ end )
545545addCommandHandler ( " unregister" , function ( player , command , arg1 )
546546 local username = arg1 or " "
547547 local result = " failed - No permission"
548- if ( hasObjectPermissionTo ( player , " function.removeAccount" ) ) then
548+ if ( hasObjectPermissionTo ( player , " function.removeAccount" , false ) ) then
549549 local account = getAccount ( username )
550550 if not account then
551551 result = " failed - Does not exist"
@@ -574,7 +574,7 @@ function getAdminNameForLog(player)
574574end
575575
576576function aAdminMenu ( player , command )
577- if ( hasObjectPermissionTo ( player , " general.adminpanel" ) ) then
577+ if ( hasObjectPermissionTo ( player , " general.adminpanel" , false ) ) then
578578 triggerClientEvent ( player , " aClientAdminMenu" , root )
579579 aPlayers [player ][" chat" ] = true
580580 end
@@ -631,7 +631,7 @@ addEventHandler ( "aTeam", root, function ( action, name, r, g, b )
631631 if checkClient ( " command." .. action , source , ' aTeam' , action ) then
632632 return
633633 end
634- if ( hasObjectPermissionTo ( client or source , " command." .. action ) ) then
634+ if ( hasObjectPermissionTo ( client or source , " command." .. action , false ) ) then
635635 mdata = " "
636636 if ( action == " createteam" ) then
637637 local success
@@ -954,7 +954,7 @@ addEventHandler ( "aPlayer", root, function ( player, action, data, additional,
954954 if not isElement ( player ) then
955955 return -- Ignore if player is no longer valid
956956 end
957- if ( hasObjectPermissionTo ( client or source , " command." .. action ) ) then
957+ if ( hasObjectPermissionTo ( client or source , " command." .. action , false ) ) then
958958 local admin = source
959959 local mdata = " "
960960 local more = " "
@@ -1168,7 +1168,7 @@ addEventHandler ( "aPlayer", root, function ( player, action, data, additional,
11681168 action = " adminr"
11691169 end
11701170 for id , p in ipairs ( getElementsByType ( " player" ) ) do
1171- if ( hasObjectPermissionTo ( p , " general.adminpanel" ) ) then triggerEvent ( " aSync" , p , " admins" ) end
1171+ if ( hasObjectPermissionTo ( p , " general.adminpanel" , false ) ) then triggerEvent ( " aSync" , p , " admins" ) end
11721172 end
11731173 else
11741174 outputChatBox ( " Error - Admin group not initialized. Please reinstall admin resource." , source , 255 , 0 ,0 )
@@ -1263,7 +1263,7 @@ end
12631263addEvent ( " aVehicle" , true )
12641264addEventHandler ( " aVehicle" , root , function ( player , action , data )
12651265 if checkClient ( " command." .. action , source , ' aVehicle' , action ) then return end
1266- if ( hasObjectPermissionTo ( client or source , " command." .. action ) ) then
1266+ if ( hasObjectPermissionTo ( client or source , " command." .. action , false ) ) then
12671267 if ( not player ) then return end
12681268 local vehicle = getPedOccupiedVehicle ( player )
12691269 if ( vehicle ) then
@@ -1347,7 +1347,7 @@ addEvent ( "aResource", true )
13471347addEventHandler ( " aResource" , root , function ( name , action )
13481348 if checkClient ( " command." .. action , source , ' aResource' , action ) then return end
13491349 local pname = getPlayerName ( source )
1350- if ( hasObjectPermissionTo ( client or source , " command." .. action ) ) then
1350+ if ( hasObjectPermissionTo ( client or source , " command." .. action , false ) ) then
13511351 local text = " "
13521352 if ( action == " start" ) then
13531353 if ( startResource ( getResourceFromName ( name ), true ) ) then
@@ -1385,7 +1385,7 @@ end )
13851385addEvent ( " aServer" , true )
13861386addEventHandler ( " aServer" , root , function ( action , data , data2 )
13871387 if checkClient ( " command." .. action , source , ' aServer' , action ) then return end
1388- if ( hasObjectPermissionTo ( client or source , " command." .. action ) ) then
1388+ if ( hasObjectPermissionTo ( client or source , " command." .. action , false ) ) then
13891389 local mdata = tostring ( data )
13901390 local mdata2 = " "
13911391 if ( action == " setgame" ) then
@@ -1536,7 +1536,7 @@ function ( action, data )
15361536 aReports [id ].read = false
15371537 -- PM all admins to say a new message has arrived
15381538 for _ , p in ipairs ( getElementsByType ( " player" ) ) do
1539- if ( hasObjectPermissionTo ( p , " general.adminpanel" ) ) then
1539+ if ( hasObjectPermissionTo ( p , " general.adminpanel" , false ) ) then
15401540 outputChatBox ( " New Admin message from " .. aReports [id ].author .. " (" .. aReports [id ].subject .. " )" , p , 255 , 0 , 0 )
15411541 end
15421542 end
@@ -1545,7 +1545,7 @@ function ( action, data )
15451545 table.remove ( aReports , 1 )
15461546 end
15471547 end
1548- if ( hasObjectPermissionTo ( client or source , " general.adminpanel" ) ) then
1548+ if ( hasObjectPermissionTo ( client or source , " general.adminpanel" , false ) ) then
15491549 if ( action == " get" ) then
15501550 triggerClientEvent ( source , " aMessage" , source , " get" , aReports , get (" reportsEnabled" ) )
15511551 elseif ( action == " read" ) then
@@ -1561,7 +1561,7 @@ function ( action, data )
15611561 end
15621562 end
15631563 for id , p in ipairs ( getElementsByType ( " player" ) ) do
1564- if ( hasObjectPermissionTo ( p , " general.adminpanel" ) ) then
1564+ if ( hasObjectPermissionTo ( p , " general.adminpanel" , false ) ) then
15651565 triggerEvent ( " aSync" , p , " messages" )
15661566 end
15671567 end
@@ -1572,7 +1572,7 @@ addEvent ( "aModdetails", true )
15721572addEventHandler ( " aModdetails" , resourceRoot , function ( action , player )
15731573 if source ~= resourceRoot then return end
15741574 if checkClient ( false , client , ' aModdetails' , action ) then return end
1575- if ( hasObjectPermissionTo ( client , " general.adminpanel" ) ) then
1575+ if ( hasObjectPermissionTo ( client , " general.adminpanel" , false ) ) then
15761576 if ( action == " get" ) then
15771577 triggerClientEvent ( client , " aModdetails" , resourceRoot , " get" , getPlayerModInfo (player ), player )
15781578 end
@@ -1582,7 +1582,7 @@ end )
15821582addEvent ( " aBans" , true )
15831583addEventHandler ( " aBans" , root , function ( action , data , arg1 , arg2 , arg3 )
15841584 if checkClient ( " command." .. action , source , ' aBans' , action ) then return end
1585- if ( hasObjectPermissionTo ( client or source , " command." .. action ) ) then
1585+ if ( hasObjectPermissionTo ( client or source , " command." .. action , false ) ) then
15861586 local mdata = " "
15871587 local more = " "
15881588 if ( action == " banip" ) then
@@ -1686,17 +1686,17 @@ function checkClient(checkAccess,player,...)
16861686 end
16871687 if checkAccess and g_Prefs .securitylevel >= 1 then
16881688 if type (checkAccess ) == ' string' then
1689- if hasObjectPermissionTo ( player , checkAccess ) then
1689+ if hasObjectPermissionTo ( player , checkAccess , false ) then
16901690 return false -- Access ok
16911691 end
1692- if hasObjectPermissionTo ( player , " general.adminpanel" ) then
1692+ if hasObjectPermissionTo ( player , " general.adminpanel" , false ) then
16931693 local desc = table.concat ({... }," " )
16941694 local ipAddress = getPlayerIP (player )
16951695 outputDebugString ( " Admin security - Client does not have required rights (" .. checkAccess .. " ). " .. tostring (ipAddress ) .. " (" .. tostring (desc ) .. " )" )
16961696 return true -- Low risk fail - Can't do specific command, but has access to admin panel
16971697 end
16981698 end
1699- if not hasObjectPermissionTo ( player , " general.adminpanel" ) then
1699+ if not hasObjectPermissionTo ( player , " general.adminpanel" , false ) then
17001700 local desc = table.concat ({... }," " )
17011701 local ipAddress = getPlayerIP (client or player )
17021702 outputDebugString ( " Admin security - Client without admin panel rights trigged an admin panel event. " .. tostring (ipAddress ) .. " (" .. tostring (desc ) .. " )" , 2 )
0 commit comments