2013martin1212 Posted August 6, 2015 Share Posted August 6, 2015 Hello all i want to create a new admin system with acl, but i stock I want to make like if the OffDutyAdmin type in duty then he get admin and he type in duty again the he turn to the offdutyAdmin acl which is same level like a normal player, but he can use the command to turn back to the admin duty and the normal players cant I read some wiki and i make like this but something is wrong function assignNewTeam ( source, commandName, teamName ) local theTeam = createTeam ( Admin ) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(playersource)), aclGetGroup("OffDutyAdmin")) then setPlayerTeam (source, theTeam) end addCommandHandler ( "duty", assignNewTeam ) Link to comment
KariiiM Posted August 6, 2015 Share Posted August 6, 2015 (edited) --Server side only ! addCommandHandler ( "duty", function (thePlayer) local theTeam = createTeam ("Admin",255,255,255) local accountname = getAccountName ( getPlayerAccount ( thePlayer )) if isObjectInACLGroup ( "user." ..accountname, aclGetGroup ( "OffDutyAdmin" )) then setPlayerTeam (thePlayer,theTeam) end end) Edited August 6, 2015 by Guest Link to comment
2013martin1212 Posted August 6, 2015 Author Share Posted August 6, 2015 I want like if a player in OffDuty acl type in duty then he get a Admin acl and removed from the OffDuty acl group and if a player in Admin acl type in offduty then he get in to the offduty acl group and removed from the admin acl group Link to comment
KariiiM Posted August 6, 2015 Share Posted August 6, 2015 I already fixed the code, what you need exactly? Because i didn't get your point EDIT: you want if the player typed /offduty he get in another team? Link to comment
2013martin1212 Posted August 6, 2015 Author Share Posted August 6, 2015 yes something like that If a player with admin acl type in offduty then he remove the admin acl team and he get a offduty acl group, and if the player was type in duty then he get admin acl and he was removed from the offduty acl Link to comment
KariiiM Posted August 6, 2015 Share Posted August 6, 2015 (edited) local offdutyTeam = createTeam ("OffDuty",100,100,100) local theTeam = createTeam ("Admin",255,255,255) addCommandHandler ( "duty", function (thePlayer) local accountname = getAccountName ( getPlayerAccount ( thePlayer )) if isObjectInACLGroup ( "user." ..accountname, aclGetGroup ( "OffDutyAdmin" )) then setPlayerTeam (thePlayer,theTeam) end end) addCommandHandler ("offduty", function (thePlayer) setPlayerTeam (thePlayer,offdutyTeam ) end) Edited August 6, 2015 by Guest Link to comment
2013martin1212 Posted August 6, 2015 Author Share Posted August 6, 2015 something like this addCommandHandler ( "duty", function (thePlayer) if isObjectInACLGroup ( "user." ..accountname, aclGetGroup ( "OffDutyAdmin" )) then --- he was set in to the admin acl group but i dont no the lua word else if isObjectInACLGroup ( "user." ..accountname, aclGetGroup ( "Admin" )) then ---* he was get back the OffDutyAdmin group and removed from the admin group end end) Link to comment
KariiiM Posted August 6, 2015 Share Posted August 6, 2015 You mean that? --Server side: You have to add your account name in ACL group "OffDutyAdmin" and "Admin" local offdutyTeam = createTeam ("OffDuty",100,100,100) local theTeam = createTeam ("Admin",255,255,255) addCommandHandler ( "duty", function (thePlayer) local accountname = getAccountName ( getPlayerAccount ( thePlayer )) if isObjectInACLGroup ( "user." ..accountname, aclGetGroup ( "OffDutyAdmin" )) then setPlayerTeam (thePlayer,offdutyTeam) else if isObjectInACLGroup ( "user." ..accountname, aclGetGroup ( "Admin" )) then setPlayerTeam (thePlayer,theTeam) end end end) Link to comment
2013martin1212 Posted August 6, 2015 Author Share Posted August 6, 2015 no because if i have a permision to the admin acl then i can use the pane, but if have a permision to the offduty then i dont have a permision to use the panel But is u have a better idea to make a script for the admins like they can play out the duty and they can use the commannds only if they are on duty then dont have unfair in game maybe now u get me because my english is not the best Link to comment
KariiiM Posted August 6, 2015 Share Posted August 6, 2015 I still didn't get your point, use translation or something to be more clear Link to comment
2013martin1212 Posted August 6, 2015 Author Share Posted August 6, 2015 i think you no the roleplay servers i want that type a admin system Link to comment
KariiiM Posted August 6, 2015 Share Posted August 6, 2015 i think you no the roleplay servers i want that type a admin system It no matter if i know RP or RPG just explain your problem more clear to let people understand it, if you can't explain then post some screenshots / videos.. Link to comment
GTX Posted August 6, 2015 Share Posted August 6, 2015 Use setAccountData instead of assigning ACL for duty state. setAccountData(getPlayerAccount(thePlayer), "duty", true) -- Onduty setAccountData(getPlayerAccount(thePlayer), "duty", true) -- Offduty Would look like this: addCommandHandler("duty", function(thePlayer) local account = getPlayerAccount(thePlayer) if not isObjectInACLGroup("user."..getAccountName(account), aclGetGroup"Admin") then return end if getAccountData(account, "duty") ~= true then setAccountData(account, "duty", true) -- Now he's onduty else setAccountData(account, "duty", false) -- Offduty. end end ) 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