Jump to content

Acl events ^^


Sora

Do you agree this suggestion ?  

25 members have voted

  1. 1. Do you agree this suggestion ?

    • Would be useful
      18
    • Maybe ..
      3
    • Wouldn't be useful
      4


Recommended Posts

hey ^^

i'm thinking of acl events like

onAclModifyObject

onAclGroupAddObject

onAclGroupRemoveObject

onAclGroupAddAcl

onAclGroupRemoveAcl

onAclCreateGroup

onAclDestroyGroup

onAclCreate

onAclDestroy

onAclSetRight

events like this would be really useful , don't you agree with me ?

with those events i can know every annoying thing and can handle it easily ^.^

Link to comment
hey ^^

i'm thinking of acl events like

onAclModifyObject

onAclGroupAddObject

onAclGroupRemoveObject

onAclGroupAddAcl

onAclGroupRemoveAcl

onAclCreateGroup

onAclDestroyGroup

onAclCreate

onAclDestroy

onAclSetRight

events like this would be really useful , don't you agree with me ?

with those events i can know every annoying thing and can handle it easily ^.^

+1

Link to comment
What would these be useful for (except for admin tools?)

That will be useful in :

For Example SoRa Create Give Permissions Panel If events have been added will develop the script is very useful ^^ For AclModifyObject , AddObject , SetRight .

Link : https://forum.multitheftauto.com/viewtopic.php?f=108&t=52663

I hope you understand what I mean and I hope add events ^ ^

Thank you for your interest ^ ^

Link to comment

eAi , you're right i wanted this for admin tools for server's security this will help me to protect my own server

w1w#ALBANDER, how funny you're , i can make my new version of this script without those events , i just can use wiki functions

which are already exist

..

thanks everybody for voting , i hope those events will be added

Link to comment

do you mean something like this? :

  
addEvent("onAclGroupAddObject") 
addEventHandler("onAclGroupAddObject",root, 
function (str1,str2) 
if str1 and str2 then 
aclGroupAddObject(aclGetGroup(tostring(str1)),tostring(str2)) 
return true 
else 
return false 
end 
end) 
  
addCommandHandler("acladdobject", 
function (player,cmd,group,object) 
if group and object then 
triggerEvent("onAclGroupAddObject",player,group,object) 
outputChatBox("* Object "..object.." successfully added to "..group.." ",player,0,255,0) 
else 
outputChatBox("* Syntax Error , type /acladdobject ",player,255,0,0) 
outputChatBox("* Object name can be user.example or resource.example ",player,255,255,0) 
end 
end) 
  
  

still if someone used the function aclGroupAddObject , he'll never trigger this event .. and even if i've overwrite the function it will never be global so will never be handled .. that's why i've requested those events to be added

Link to comment

That's not what I meant.

__aclGroupAddObject = aclGroupAddObject; 
function aclGroupAddObject ( ... ) 
    if ( __aclGroupAddObject ( ... ) ) then 
        triggerEvent ( "onACLGroupObjectAdd", root, ... ); 
        return true 
    end 
    return false 
end 

Just make a resource for things you will use in multiple other resources and export them.

Link to comment

i didn't meant this .. look for example , if someone tried to use the function

aclGroupAddObject it will never tirgger the event above ^

he must use somethng like exports.resourcename: aclGroupAddObject(...)

the event would be global if it was defined by mta

so i can use something like

addEventHandler("onAclGroupAddObject",root, 
function () 
if something() then 
cancelEvent() 
end 
end) 

or something like

addEventHandler("onAclGroupAddObject",root, 
function (group,object) 
outputServerLog("Object "..obejct.."  added to "..group.." by "..getPlayerName(source) or getResourceName(source).." ") 
end) 

Link to comment
i didn't meant this .. look for example , if someone tried to use the function

aclGroupAddObject it will never tirgger the event above ^

he must use somethng like exports.resourcename: aclGroupAddObject(...)

the event would be global if it was defined by mta

so i can use something like

addEventHandler("onAclGroupAddObject",root, 
function () 
if something() then 
cancelEvent() 
end 
end) 

or something like

addEventHandler("onAclGroupAddObject",root, 
function (group,object) 
outputServerLog("Object "..obejct.."  added to "..group.." by "..getPlayerName(source) or getResourceName(source).." ") 
end) 

MTA Team doesn't have to make it an event. You only use wrappers for such, just like Anderl showed. It works perfectly.

Link to comment
  • 1 month later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...