xXMADEXx Posted September 16, 2012 Share Posted September 16, 2012 Hey MTA, this is my first topic and i need somone who can make my script command work for only the acl group named Military. If you can do that, let me know please. -xXMADEXx Download to script - http://www.mediafire.com/?xx60g6k1d1cm9j7 Just please somone make the script only work for ACL group named Military thanks. Link to comment
Alan.Alexander Posted September 17, 2012 Share Posted September 17, 2012 https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup Link to comment
xXMADEXx Posted September 17, 2012 Author Share Posted September 17, 2012 https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup i didnt work Link to comment
Alan.Alexander Posted September 17, 2012 Share Posted September 17, 2012 if isObjectInACLGroup("user."..accName,aclGetGroup("Admin")) then return; end Add that as teh first line of a function you want to stop someone using based on ACL? Link to comment
xXMADEXx Posted September 17, 2012 Author Share Posted September 17, 2012 if isObjectInACLGroup("user."..accName,aclGetGroup("Admin")) then return; end The ACL is the only way i can think of making it so if your in the military, you can leave to join a job and use /military to get back into it, I wish the script work, im not much of a scripter. Link to comment
xXMADEXx Posted September 17, 2012 Author Share Posted September 17, 2012 This is my script: function togglestaffMode(thePlayer) local account = getPlayerAccount(thePlayer) if (not account or isGuestAccount(account)) then return end local accountName = getAccountName(account) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "military" ) ) ) then if getElementData(thePlayer,"invincible") then setElementData(thePlayer,"invincible",false) outputChatBox("Staff Mode is now off.",thePlayer,255,0,0) else setElementData(thePlayer,"invincible",false) outputChatBox("Staff Mode is now on.",thePlayer,0,255,0) end end end function createTeamsOnStart () teammili = createTeam ( "Military", 0, 255, 0 ) end addEventHandler("onResourceStart", resourceRoot, createTeamsOnStart) function lol ( player, command ) setPlayerTeam ( player, teammili ) setPlayerSkin(player, 287) end addCommandHandler ( "military", lol ) Link to comment
robhol Posted September 17, 2012 Share Posted September 17, 2012 There's no need for checking this via script - in fact, it's bad practice since MTA already handles this kind of thing. Disallow the command from the default/Everyone group, allow it specifically for the group(s) that's supposed to use it. Just look at acl.xml and you'll figure out the pattern - if you get in trouble, read the wiki. Moved to scripting. Link to comment
xXMADEXx Posted September 17, 2012 Author Share Posted September 17, 2012 There's no need for checking this via script - in fact, it's bad practice since MTA already handles this kind of thing. Disallow the command from the default/Everyone group, allow it specifically for the group(s) that's supposed to use it. Just look at acl.xml and you'll figure out the pattern - if you get in trouble, read the wiki.Moved to scripting. OMFG how did i not think of that, i do it all the time, today just isnt my day Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now