Jump to content

Restricting some function


MIKI785

Recommended Posts

Posted

Is there any way how to restrict any function in the ACL? For example function setVehicleColor only to group admin.

I tried to disallow acces in default group but it still can be used by any resource.

Is it possible to restrict it?

Lua Scripter

?ucet=miki_cz

Owner of mshost.cz MTA portal.

Posted

That should be possible, yes. Mind posting your acl?

Do NOT PM ME for help unless invited. - New MTA Script Editor

Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.

Posted

ok, add this to the Default ACL Group(not at the top. In the list):

name="function.setVehicleColor" access="true" />

and add this in every other Group ACL List:

name="function.setVehicleColor" access="false" />

in the script you would need to use this:

HasObjectPermissionTo 

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

Posted

Jay what you are doing is making everybody that is not in the group Default not able to call this command.

What you need to do is use

     <right name="function.setVehicleColor" access="true" />  

where you want the function to be usable.

and use

     <right name="function.setVehicleColor" access="false" />  

where you dont want it to be usable.

then make sure all the ACL rights are correct ofcourse :)

Posted
Jay what you are doing is making everybody that is not in the group Default not able to call this command.

What you need to do is use

     <right name="function.setVehicleColor" access="true" />  

where you want the function to be usable.

and use

     <right name="function.setVehicleColor" access="false" />  

where you dont want it to be usable.

then make sure all the ACL rights are correct ofcourse :)

that's what I was doing...

I don't want to use hasObjectPermissionTo() because what i want is to make sure that scripts in the maps won't be able to change vehicle's color, as the players on my server have fixed color based on their clan color.

Lua Scripter

?ucet=miki_cz

Owner of mshost.cz MTA portal.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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