Hero192 Posted June 22, 2015 Share Posted June 22, 2015 (edited) *Problem solved* Edited June 23, 2015 by Guest Link to comment
jingzhi Posted June 22, 2015 Share Posted June 22, 2015 Anyone please? You want to change stuff like "Level 1","Level 2" to for instance "Trial","Advanced", is that your question? If so, you should change the strings with "Level 1" or "Level 2" to whatever you want Link to comment
Hero192 Posted June 22, 2015 Author Share Posted June 22, 2015 Yeah thats what i mean,I tried that but not working ,i know the custom ranks must be in the ACL admin too but the problem is in how to switch them to custom ranks Link to comment
jingzhi Posted June 22, 2015 Share Posted June 22, 2015 Yeah thats what i mean,I tried that but not working ,i know the custom ranks must be in the ACL admin too but the problem is in how to switch them to custom ranks You should change the name of his original acl groups to the ones you want Link to comment
Hero192 Posted June 23, 2015 Author Share Posted June 23, 2015 Doesn't works even if i changed the default ranks to custom and adding them in ACL ,help me please? Link to comment
Walid Posted June 23, 2015 Share Posted June 23, 2015 Doesn't works even if i changed the default ranks to custom and adding them in ACL ,help me please? There is more than one way to do it. Example 1 : -- Using table local Ranks = {"Trial Staff","Trained Staff","Etc ..."} -- Put all your ranks here and make sure to add them all to your ACL.xml file. -- function to check if the player staff or not function isPlayerStaff (player) if isElement(player) and getElementType (player) == "player" then for a, g in ipairs (Ranks) do if isPlayerInACL (player,g) then return true end end end return false end -- get staff rank function getStaffRank (player) if isPlayerStaff (player) then for a, g in ipairs (Ranks) do if isPlayerInACL (player,g) then return tostring (g) end end end return false end function isPlayerInACL ( player, acl ) local account = getPlayerAccount ( player ) if ( isGuestAccount ( account ) ) then return false end if ( aclGetGroup ( acl ) ) then return isObjectInACLGroup ( "user."..getAccountName ( account ), aclGetGroup ( acl ) ) end return false; end function getOnlineStaff ( ) local online = { } for i, v in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerStaff ( v ) ) then table.insert ( online, v ) end end return online end Example 2 : -- Add all admins accounts name inside a tabe like this Admins = { {"Bla ", "Head Staff"}, {"Bla Bla","Trial Staff"}, } function staffRanks(_,acc) for index, data in pairs(Admins) do if (getAccountName(acc) == data[1]) then setElementData(source, "staffRank", data[2]) end end end addEventHandler("onPlayerLogin", root, staffRank) function isPlayerStaff(player) if isElement(player) then if (getElementData(player, "staffRank")) then return true else return false end end return false end function getStaffRank (player) if isPlayerStaff (player) then return getElementData(player, "staffRank") end end -- Etc ... Link to comment
Hero192 Posted June 23, 2015 Author Share Posted June 23, 2015 It still doesn't works. 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