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

Posted

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 ^.^

Posted
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

Posted

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

Posted (edited)

If you Can , make it Now ! , :lol:

i make it whenever i want to .. , your reply isn't belong to here so stop bothering me :\

Edited by Guest
Posted

These events are not useful, since you can make your own event or function doing whatever you want. I don't think these events would be used in much of scripts at all.

Posted

As said above, you can already make that. As long as ACL is modified using functions implemented in LUA, you can use make wrappers of the functions to call events.

Posted

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

Posted

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.

Posted

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) 

Posted
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.

Posted

The problem is what anderl showed, isn't global it need to be exported

i wanted these or those events to do like what i said above ^

thanks anderl and myonlake and everybody for voting .. let us just see what is mta team opinion

Posted

I am not trying to block the team to not add this feature, but it can be very easily obtained by wrappers.

Does it have to be global? What's so wrong about exported functions? Almost all professional scripts use exported functions.

  • 1 month later...
  • Recently Browsing   0 members

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