vidadeboy13 Posted November 3, 2014 Share Posted November 3, 2014 Who can help me? I have this script, and there is a command: /dog, i wanna make this this command be used only by ADMINS that are in the ACL. How? Here the is two parts of the script! PART 1: addCommandHandler("dog", DMCreateDog) addCommandHandler("deletedog", DMDeleteDog) addCommandHandler("unlockall", DMUnlockAll) PART 2: --DOG CREATOR function DMCreateDog() if(DMClientOwnerGotDog == true)then outputChatBox("You already have a dog!", 255, 0,0) else if(DMDogPanel == true)then removeEventHandler("onClientRender", getRootElement(), DMDogPanelGui) DMDogPanel = false guiSetVisible(DMDogPanelButton1, false) guiSetVisible(DMDogPanelButton2, false) guiSetVisible(DMDogPanelButton3, false) guiSetVisible(DMDogPanelButton4, false) guiSetVisible(DMDogPanelButton5, false) guiSetVisible(DMDogPanelButton6, false) guiSetVisible(DMDogPanelButton7, false) showCursor(false) end Link to comment
Bilal135 Posted November 3, 2014 Share Posted November 3, 2014 if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(Player)), aclGetGroup ( "Admin" ) ) then --Functions Here-- You need to return also. (After Functions): else return outputChatBox("This command can be used by admins only!", Player, 255, 0, 0, false) Btw, you posted this in the wrong section, should be in the scripting section. Link to comment
vidadeboy13 Posted November 3, 2014 Author Share Posted November 3, 2014 Sorry for this.... I dont have much experience with scripts, in which part of my script, I have to add Your script? Link to comment
Bilal135 Posted November 3, 2014 Share Posted November 3, 2014 Try this: PART 1: addCommandHandler("dog", DMCreateDog) addCommandHandler("deletedog", DMDeleteDog) addCommandHandler("unlockall", DMUnlockAll) PART 2: --DOG CREATOR function DMCreateDog() if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(Player)), aclGetGroup ( "Admin" ) ) then else return outputChatBox("This command can be used by admins only!", Player, 255, 0, 0, false) end if(DMClientOwnerGotDog == true)then outputChatBox("You already have a dog!", 255, 0,0) else if(DMDogPanel == true)then removeEventHandler("onClientRender", getRootElement(), DMDogPanelGui) DMDogPanel = false guiSetVisible(DMDogPanelButton1, false) guiSetVisible(DMDogPanelButton2, false) guiSetVisible(DMDogPanelButton3, false) guiSetVisible(DMDogPanelButton4, false) guiSetVisible(DMDogPanelButton5, false) guiSetVisible(DMDogPanelButton6, false) guiSetVisible(DMDogPanelButton7, false) showCursor(false) end Link to comment
vidadeboy13 Posted November 3, 2014 Author Share Posted November 3, 2014 The resource works, but the commando dont work, the command dont work for players and not for admin too. Link to comment
xeon17 Posted November 3, 2014 Share Posted November 3, 2014 Use this , don't forget to do the following thing. Admin Panel > Resources > Manage ACL > ADMIN ACL > add right > and add ''command.dog'' Admin Panel > Resources > Manage ACL > ADMIN ACL > add right > and add ''command.deletedog'' Admin Panel > Resources > Manage ACL > ADMIN ACL > add right > and add ''command.unlockall PART 1: addCommandHandler("dog", DMCreateDog,true) addCommandHandler("deletedog", DMDeleteDog,true) addCommandHandler("unlockall", DMUnlockAll,true) PART 2: --DOG CREATOR function DMCreateDog() if(DMClientOwnerGotDog == true)then outputChatBox("You already have a dog!", 255, 0,0) else if(DMDogPanel == true)then removeEventHandler("onClientRender", getRootElement(), DMDogPanelGui) DMDogPanel = false guiSetVisible(DMDogPanelButton1, false) guiSetVisible(DMDogPanelButton2, false) guiSetVisible(DMDogPanelButton3, false) guiSetVisible(DMDogPanelButton4, false) guiSetVisible(DMDogPanelButton5, false) guiSetVisible(DMDogPanelButton6, false) guiSetVisible(DMDogPanelButton7, false) showCursor(false) end ' Link to comment
vidadeboy13 Posted November 3, 2014 Author Share Posted November 3, 2014 I do this And continue not working, the resource works, but Players and Admin admins can't use the command /dog. Anyone can help me, Please? Link to comment
xeon17 Posted November 3, 2014 Share Posted November 3, 2014 Show your ACL.xml and the code you're using at the momment. and check /debugscript 3 for errors. Link to comment
vidadeboy13 Posted November 3, 2014 Author Share Posted November 3, 2014 No errors in debug 3. My acl.xml is: <acl> <group name="Everyone"> <acl name="Default"></acl> <object name="user.*"></object> </group> <group name="Moderator"> <acl name="Moderator"></acl> <object name="resource.mapcycler"></object> <object name="resource.mapmanager"></object> <object name="resource.resourcemanager"></object> <object name="resource.votemanager"></object> </group> <group name="SuperModerator"> <acl name="Moderator"></acl> <acl name="SuperModerator"></acl> </group> <group name="Admin"> <acl name="Moderator"></acl> <acl name="SuperModerator"></acl> <acl name="Admin"></acl> <acl name="RPC"></acl> <object name="resource.admin"></object> <object name="user.wallace"></object> <object name="resource.webadmin"></object> <object name="user.Diego"></object> <object name="user.duzera"></object> <object name="user.galegods"></object> <object name="resource.toolbox"></object> <object name="user.minhokao"></object> </group> <group name="Console"> <acl name="Moderator"></acl> <acl name="SuperModerator"></acl> <acl name="Admin"></acl> <acl name="RPC"></acl> <object name="user.Console"></object> <object name="user.wallace"></object> </group> <group name="RPC"> <acl name="RPC"></acl> </group> <group name="MapEditor"> <acl name="Default"></acl> <acl name="MapEditor"></acl> <object name="resource.editor_main"></object> <object name="resource.edf"></object> <object name="resource.toolbox"></object> </group> <group name="raceACLGroup"> <acl name="Default"></acl> <acl name="raceACL"></acl> <object name="resource.race"></object> </group> <group name="DevGroup"> <acl name="DevACL"></acl> </group> <group name="autoGroup_acpanel"> <acl name="autoACL_acpanel"></acl> <object name="resource.acpanel"></object> </group> <group name="VIPDOG"> <acl name="VIPDOG"></acl> </group> <group name="VIP"> <object name="user.wallace"></object> </group> <acl name="Default"> <right name="general.ModifyOtherObjects" access="false"></right> <right name="command.dog" access="false"></right> <right name="general.http" access="false"></right> <right name="command.start" access="false"></right> <right name="command.stop" access="false"></right> <right name="command.stopall" access="false"></right> <right name="command.gamemode" access="false"></right> <right name="command.changemode" access="false"></right> <right name="command.changemap" access="false"></right> <right name="command.stopmode" access="false"></right> <right name="command.stopmap" access="false"></right> <right name="command.skipmap" access="false"></right> <right name="command.restart" access="false"></right> <right name="command.refresh" access="false"></right> <right name="command.refreshall" access="false"></right> <right name="command.addaccount" access="false"></right> <right name="command.delaccount" access="false"></right> <right name="command.debugscript" access="false"></right> <right name="command.chgpass" access="false"></right> <right name="command.loadmodule" access="false"></right> <right name="command.upgrade" access="false"></right> <right name="command.mute" access="false"></right> <right name="command.crun" access="false"></right> <right name="command.srun" access="false"></right> <right name="command.run" access="false"></right> <right name="command.unmute" access="false"></right> <right name="command.kick" access="false"></right> <right name="command.ban" access="false"></right> <right name="command.banip" access="false"></right> <right name="command.unbanip" access="false"></right> <right name="command.reloadbans" access="false"></right> <right name="command.shutdown" access="false"></right> <right name="command.install" access="false"></right> <right name="command.aexec" access="false"></right> <right name="command.whois" access="false"></right> <right name="command.whowas" access="false"></right> <right name="function.executeCommandHandler" access="false"></right> <right name="function.setPlayerMuted" access="false"></right> <right name="function.addAccount" access="false"></right> <right name="function.addBan" access="false"></right> <right name="function.setUnbanTime" access="false"></right> <right name="function.setBanAdmin" access="false"></right> <right name="function.setBanReason" access="false"></right> <right name="function.removeBan" access="false"></right> <right name="function.removeAccount" access="false"></right> <right name="function.setAccountPassword" access="false"></right> <right name="function.kickPlayer" access="false"></right> <right name="function.banIP" access="false"></right> <right name="function.banPlayer" access="false"></right> <right name="function.banSerial" access="false"></right> <right name="function.getBansXML" access="false"></right> <right name="function.unbanIP" access="false"></right> <right name="function.unbanSerial" access="false"></right> <right name="function.reloadBans" access="false"></right> <right name="function.setServerPassword" access="false"></right> <right name="function.getServerPassword" access="false"></right> <right name="function.callRemote" access="false"></right> <right name="function.fetchRemote" access="false"></right> <right name="function.startResource" access="false"></right> <right name="function.stopResource" access="false"></right> <right name="function.restartResource" access="false"></right> <right name="function.createResource" access="false"></right> <right name="function.copyResource" access="false"></right> <right name="function.addResourceMap" access="false"></right> <right name="function.addResourceConfig" access="false"></right> <right name="function.removeResourceFile" access="false"></right> <right name="function.setResourceDefaultSetting" access="false"></right> <right name="function.removeResourceDefaultSetting" access="false"></right> <right name="function.redirectPlayer" access="false"></right> <right name="function.aclReload" access="false"></right> <right name="function.aclSave" access="false"></right> <right name="function.aclCreate" access="false"></right> <right name="function.aclDestroy" access="false"></right> <right name="function.aclSetRight" access="false"></right> <right name="function.aclRemoveRight" access="false"></right> <right name="function.aclCreateGroup" access="false"></right> <right name="function.aclDestroyGroup" access="false"></right> <right name="function.aclGroupAddACL" access="false"></right> <right name="function.aclGroupRemoveACL" access="false"></right> <right name="function.aclGroupAddObject" access="false"></right> <right name="function.aclGroupRemoveObject" access="false"></right> <right name="function.refreshResources" access="false"></right> <right name="function.setServerConfigSetting" access="false"></right> <right name="function.updateResourceACLRequest" access="false"></right> <right name="command.aclrequest" access="false"></right> <right name="general.adminpanel" access="false"></right> <right name="general.tab_players" access="false"></right> <right name="general.tab_resources" access="false"></right> <right name="general.tab_maps" access="false"></right> <right name="general.tab_server" access="false"></right> <right name="general.tab_bans" access="false"></right> <right name="general.tab_adminchat" access="false"></right> <right name="command.freeze" access="false"></right> <right name="command.setnick" access="false"></right> <right name="command.shout" access="false"></right> <right name="command.spectate" access="false"></right> <right name="command.slap" access="false"></right> <right name="command.setgroup" access="false"></right> <right name="command.sethealth" access="false"></right> <right name="command.setarmour" access="false"></right> <right name="command.setmoney" access="false"></right> <right name="command.setskin" access="false"></right> <right name="command.setteam" access="false"></right> <right name="command.giveweapon" access="false"></right> <right name="command.setstat" access="false"></right> <right name="command.jetpack" access="false"></right> <right name="command.warp" access="false"></right> <right name="command.setdimension" access="false"></right> <right name="command.setinterior" access="false"></right> <right name="command.givevehicle" access="false"></right> <right name="command.repair" access="false"></right> <right name="command.blow" access="false"></right> <right name="command.destroy" access="false"></right> <right name="command.customize" access="false"></right> <right name="command.setcolor" access="false"></right> <right name="command.setpaintjob" access="false"></right> <right name="command.listmessages" access="false"></right> <right name="command.readmessage" access="false"></right> <right name="command.listresources" access="false"></right> <right name="command.execute" access="false"></right> <right name="command.delete" access="false"></right> <right name="command.setpassword" access="false"></right> <right name="command.setwelcome" access="false"></right> <right name="command.setgame" access="false"></right> <right name="command.setmap" access="false"></right> <right name="command.setweather" access="false"></right> <right name="command.blendweather" access="false"></right> <right name="command.setblurlevel" access="false"></right> <right name="command.setwaveheight" access="false"></right> <right name="command.setskygradient" access="false"></right> <right name="command.setgamespeed" access="false"></right> <right name="command.setgravity" access="false"></right> <right name="command.settime" access="false"></right> <right name="function.shutdown" access="false"></right> <right name="command.setfpslimit" access="false"></right> <right name="command.fetchRemote" access="false"></right> <right name="command.unban" access="false"></right> <right name="command.banserial" access="false"></right> <right name="command.unbanserial" access="false"></right> <right name="command.listbans" access="false"></right> </acl> <acl name="Moderator"> <right name="general.ModifyOtherObjects" access="false"></right> <right name="command.gamemode" access="true"></right> <right name="command.changemode" access="true"></right> <right name="command.changemap" access="true"></right> <right name="command.stopmode" access="true"></right> <right name="command.stopmap" access="true"></right> <right name="command.skipmap" access="true"></right> <right name="command.mute" access="true"></right> <right name="command.unmute" access="true"></right> <right name="command.whois" access="true"></right> <right name="command.whowas" access="true"></right> <right name="function.setPlayerMuted" access="true"></right> <right name="function.kickPlayer" access="true"></right> <right name="function.banIP" access="true"></right> <right name="function.banPlayer" access="true"></right> <right name="function.banSerial" access="true"></right> <right name="function.getBansXML" access="true"></right> <right name="function.unbanIP" access="true"></right> <right name="function.unbanSerial" access="true"></right> <right name="function.startResource" access="true"></right> <right name="function.stopResource" access="true"></right> <right name="function.restartResource" access="true"></right> <right name="function.redirectPlayer" access="true"></right> <right name="general.adminpanel" access="true"></right> <right name="general.tab_players" access="true"></right> <right name="general.tab_resources" access="false"></right> <right name="general.tab_maps" access="false"></right> <right name="general.tab_server" access="true"></right> <right name="general.tab_bans" access="false"></right> <right name="general.tab_adminchat" access="true"></right> <right name="command.kick" access="false"></right> <right name="command.freeze" access="true"></right> <right name="command.setnick" access="true"></right> <right name="command.shout" access="true"></right> <right name="command.spectate" access="true"></right> <right name="command.slap" access="true"></right> <right name="command.setgroup" access="false"></right> <right name="command.sethealth" access="true"></right> <right name="command.setarmour" access="true"></right> <right name="command.setmoney" access="false"></right> <right name="command.setskin" access="true"></right> <right name="command.setteam" access="true"></right> <right name="command.giveweapon" access="true"></right> Link to comment
xeon17 Posted November 3, 2014 Share Posted November 3, 2014 Everything is ok , i don't know what is the problem. Could you post the code how it look at the moment? Link to comment
vidadeboy13 Posted November 3, 2014 Author Share Posted November 3, 2014 Yes, here it is: http://codeviewer.org/view/code:4683 Is possible to do what i wanna? Link to comment
Bilal135 Posted November 3, 2014 Share Posted November 3, 2014 You may ask the actual creator of this script, Super Brandy. His profile link: memberlist.php?mode=viewprofile&u=78730 Link to comment
vidadeboy13 Posted November 3, 2014 Author Share Posted November 3, 2014 But, nobody can do this? Link to comment
Bilal135 Posted November 3, 2014 Share Posted November 3, 2014 I'm not sure that what is the problem in the script. Link to comment
vidadeboy13 Posted November 3, 2014 Author Share Posted November 3, 2014 Please, try, do you wnna the full resource? Link to comment
Bilal135 Posted November 3, 2014 Share Posted November 3, 2014 Its already on the community, no need for it. Link to comment
vidadeboy13 Posted November 3, 2014 Author Share Posted November 3, 2014 And so, can you try to make it for me? Link to comment
Tekken Posted November 3, 2014 Share Posted November 3, 2014 try to add in acl this on Admin group Link to comment
vidadeboy13 Posted November 3, 2014 Author Share Posted November 3, 2014 mihayy5, a do this now, but continue not working Link to comment
Bilal135 Posted November 3, 2014 Share Posted November 3, 2014 Post the last code you tried. ( [ lua ] ) Link to comment
vidadeboy13 Posted November 3, 2014 Author Share Posted November 3, 2014 Here it Is: --DOG CREATOR function DMCreateDog() if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(Player)), aclGetGroup ( "Admin" ) ) then else return outputChatBox("This command can be used by admins only!", Player, 255, 0, 0, false) end if(DMClientOwnerGotDog == true)then outputChatBox("You already have a dog!", 255, 0,0) else if(DMDogPanel == true)then removeEventHandler("onClientRender", getRootElement(), DMDogPanelGui) DMDogPanel = false guiSetVisible(DMDogPanelButton1, false) guiSetVisible(DMDogPanelButton2, false) guiSetVisible(DMDogPanelButton3, false) guiSetVisible(DMDogPanelButton4, false) guiSetVisible(DMDogPanelButton5, false) guiSetVisible(DMDogPanelButton6, false) guiSetVisible(DMDogPanelButton7, false) showCursor(false) end And The full code is here in this link: http://codeviewer.org/view/code:4685 Link to comment
xeon17 Posted November 3, 2014 Share Posted November 3, 2014 Why you ignored my post? i already given you the code which will work. Use this , don't forget to do the following thing.Admin Panel > Resources > Manage ACL > ADMIN ACL > add right > and add ''command.dog'' Admin Panel > Resources > Manage ACL > ADMIN ACL > add right > and add ''command.deletedog'' Admin Panel > Resources > Manage ACL > ADMIN ACL > add right > and add ''command.unlockall PART 1: addCommandHandler("dog", DMCreateDog,true) addCommandHandler("deletedog", DMDeleteDog,true) addCommandHandler("unlockall", DMUnlockAll,true) PART 2: --DOG CREATOR function DMCreateDog() if(DMClientOwnerGotDog == true)then outputChatBox("You already have a dog!", 255, 0,0) else if(DMDogPanel == true)then removeEventHandler("onClientRender", getRootElement(), DMDogPanelGui) DMDogPanel = false guiSetVisible(DMDogPanelButton1, false) guiSetVisible(DMDogPanelButton2, false) guiSetVisible(DMDogPanelButton3, false) guiSetVisible(DMDogPanelButton4, false) guiSetVisible(DMDogPanelButton5, false) guiSetVisible(DMDogPanelButton6, false) guiSetVisible(DMDogPanelButton7, false) showCursor(false) end ' try to add in acl this on Admin group If he add he add the resource in ACL , this will change nothing. Link to comment
vidadeboy13 Posted November 3, 2014 Author Share Posted November 3, 2014 zeon, it doesnt work too, everybody could use the resource, and i wanna olnly admins 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