xeon17 Posted February 4, 2014 Share Posted February 4, 2014 Whitch functions should i use to crate a Gang Level script , extample: Lider , Sub-Lider , Comandant , Member , Guest. Everyone level have pemmsions , i can manage the pemmsions extample : command /gang kick if getElementData = Lider then THE KICK SCRIPT. I no understand much about getElementData or setElementData or should i use setAccountData etc etc. Sorry for my bad english , i hope someone understand me '-' Link to comment
novo Posted February 4, 2014 Share Posted February 4, 2014 (edited) Try with these functions: aclGetGroup(); -- [url=https://wiki.multitheftauto.com/wiki/AclGetGroup]https://wiki.multitheftauto.com/wiki/AclGetGroup[/url] aclCreateGroup(); -- [url=https://wiki.multitheftauto.com/wiki/AclCreateGroup]https://wiki.multitheftauto.com/wiki/AclCreateGroup[/url] isObjectInACLGroup(); -- [url=https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup]https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup[/url] -- Example code local gangs = {"Lider", "Sub-lider"} for i = 1, #gangs do if not aclGetGroup(gangs[i]) then aclCreateGroup(gangs[i]) end end function example (player, cmd, gcmd) local account = getPlayerAccount(player) if not isGuestAccount(account) then local accountname = getAccountName(account) if isObjectInACLGroup("user." ..accountname, aclGetGroup("Lider")) then -- Check if player's in Lider's acl group (gang) if gcmd == "kick" then -- Player used /gang kick end end end end addCommandHandler("gang", example) Edited February 7, 2014 by Guest Link to comment
xeon17 Posted February 4, 2014 Author Share Posted February 4, 2014 Yes i know it works with ACL , but i thinked something other if is possible. to Crate extample some Element or Account data , Lider , Sub , Comandant , Member , Guest. i created allerdy a great Gang System extample when player create a gang it give him ElementData or Account data Lider. Link to comment
novo Posted February 4, 2014 Share Posted February 4, 2014 Use getAccountData and setAccountData with player's account or getElementData and setElementData if player isn't logged in Link to comment
xeon17 Posted February 4, 2014 Author Share Posted February 4, 2014 then AccountData is better , a extample please ? how to crate a accountdata ? i frist time work with this function Link to comment
Saml1er Posted February 4, 2014 Share Posted February 4, 2014 (edited) [lua] addEventHandler("onPlayerWasted", getRootElement(), function () local accName = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ( "user."..accName, aclGetGroup ( "Admin" ), ) then setAccountData ( getPlayerAccount(source), "example.hh", "Noob") if getAccountData ( getPlayerAccount(source), "example.hh") == "Noob" then outputChatBox ("R.I.P; Admin: "..accName.." has died",getRootElement(), 255, 255, 0, false ) end end end)[/lua Edited February 5, 2014 by Guest Link to comment
xeon17 Posted February 5, 2014 Author Share Posted February 5, 2014 Thank you guys , i understand it now 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