shoBy Posted September 1, 2014 Share Posted September 1, 2014 How can I remove the access to admin panel for vip and superman command from vip, members and other ranks ? Link to comment
xeon17 Posted September 1, 2014 Share Posted September 1, 2014 https://wiki.multitheftauto.com/wiki/ACL dude.. Link to comment
shoBy Posted September 1, 2014 Author Share Posted September 1, 2014 Man...How to remove acces, that is what I want to know Link to comment
xeon17 Posted September 1, 2014 Share Posted September 1, 2014 "VIP"> "command.kick" access="true" /> "VIP"> Link to comment
shoBy Posted September 1, 2014 Author Share Posted September 1, 2014 Like this ? (acl.xml) <acl name="Default"> <right name="general.ModifyOtherObjects" access="false"></right> <right name="command.superman" access="false" /> This: : Is not important. EDIT: Where did you edited? Link to comment
shoBy Posted September 1, 2014 Author Share Posted September 1, 2014 It doesn't work I tryed on acleditor and acl...Doesn't work ( help please!! Link to comment
xeon17 Posted September 1, 2014 Share Posted September 1, 2014 Shut down server first , then edit ACL.. Link to comment
shoBy Posted September 1, 2014 Author Share Posted September 1, 2014 <acl> <group name="Everyone"> <acl name="Default"></acl> <object name="user.*"></object> <object name="resource.*"></object> </group> <group name="lvl 1"> <acl name="lvl 1"></acl> <object name="resource.admin"></object> <object name="resource.mapcycler"></object> <object name="resource.mapmanager"></object> <object name="resource.resourcemanager"></object> <object name="resource.votemanager"></object> </group> <group name="lvl 2"> <acl name="lvl 2"></acl> <object name="resource.admin"></object> <object name="resource.mapcycler"></object> <object name="resource.mapmanager"></object> <object name="resource.resourcemanager"></object> <object name="resource.votemanager"></object> </group> <group name="lvl 3"> <acl name="lvl 3"></acl> <object name="resource.admin"></object> <object name="resource.mapcycler"></object> <object name="resource.mapmanager"></object> <object name="resource.resourcemanager"></object> <object name="resource.votemanager"></object> </group> <group name="lvl 4"> <acl name="lvl 4"></acl> <object name="resource.admin"></object> <object name="resource.mapcycler"></object> <object name="resource.mapmanager"></object> <object name="resource.resourcemanager"></object> <object name="resource.votemanager"></object> </group> <group name="lvl 5"> <acl name="lvl 5"></acl> <object name="resource.admin"></object> <object name="resource.mapcycler"></object> <object name="resource.mapmanager"></object> <object name="resource.resourcemanager"></object> <object name="resource.votemanager"></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="resource.countryid"></object> <object name="resource.toolbox"></object> <object name="resource.race_start_pack"></object> </group> <group name="Owner"> <acl name="Moderator"></acl> <acl name="SuperModerator"></acl> <acl name="Admin"></acl> <acl name="Owner"></acl> <acl name="RPC"></acl> </group> <group name="VIP"> <acl name="Moderator"></acl> <acl name="SuperModerator"></acl> <acl name="Admin"></acl> <acl name="Owner"></acl> <acl name="VIP"></acl> <acl name="RPC"></acl> </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> </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="user.testing"></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="admin - Trial"></group> <group name="Co Leader"></group> <acl name="Default"> <right name="general.ModifyOtherObjects" access="false"></right> <right name="command.superman" access="false" /> <right name="general.http" access="false"></right> <right name="command.redo" access="false"></right> <right name="command.nextmap" access="false"></right> <right name="command.gm" access="false"></right> <right name="command.ghostmode" access="false"></right> <right name="command.push" access="false"></right> <right name="command.smash" access="false"></right> <right name="command.givecash" 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.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="true"></right> <right name="function.addBan" access="true"></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.getClientIP" 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.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="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.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.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="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> <right name="command.random" access="false"></right> <right name="command.setnick" access="false"></right> <right name="command.delete" access="false"></right> <right name="function.shutdown" access="false"></right> <right name="command.setfpslimit" access="false"></right> <right name="command.fetchRemote" access="false"></right> </acl> <acl name="lvl 1"> <right name="general.ModifyOtherObjects" access="false"></right> <right name="command.superman" access="false" /> <right name="command.push" access="false"></right> Link to comment
xeon17 Posted September 1, 2014 Share Posted September 1, 2014 Just edit , delete commands/functions add them.. whatever.. "VIP"> "general.ModifyOtherObjects" access="false"> "command.push" access="false"> "command.smash" access="false"> "command.redo" access="false"> "command.nextmap" access="false"> "command.gm" access="false"> "command.ghostmode" access="false"> "command.gamemode" access="false"> "command.changemode" access="false"> "command.changemap" access="false"> "command.stopmode" access="false"> "command.stopmap" access="false"> "command.skipmap" access="false"> "command.mute" access="false"> "command.unmute" access="false"> "command.whois" access="false"> "command.whowas" access="false"> "function.setPlayerMuted" access="false"> "function.kickPlayer" access="false"> "function.banIP" access="false"> "function.banPlayer" access="false"> "function.banSerial" access="false"> "function.getBansXML" access="false"> "function.unbanIP" access="false"> "function.unbanSerial" access="false"> "function.getClientIP" access="false"> "function.startResource" access="false"> "function.stopResource" access="false"> "function.restartResource" access="false"> "function.redirectPlayer" access="false"> "general.adminpanel" access="false"> "general.tab_players" access="false"> "general.tab_resources" access="false"> "general.tab_maps" access="false"> "general.tab_server" access="false"> "general.tab_bans" access="false"> "general.tab_adminchat" access="false"> "command.kick" access="false"> "command.freeze" access="false"> "command.shout" access="false"> "command.spectate" access="false"> "command.slap" access="false"> "command.setgroup" access="false"> "command.sethealth" access="false"> "command.setarmour" access="false"> "command.setmoney" access="false"> "command.setskin" access="false"> "command.setteam" access="false"> "command.giveweapon" access="false"> "command.setstat" access="false"> "command.jetpack" access="false"> "command.warp" access="false"> "command.setdimension" access="false"> "command.setinterior" access="false"> "command.createteam" access="false"> "command.destroyteam" access="false"> "command.givevehicle" access="false"> "command.repair" access="false"> "command.blowvehicle" access="false"> "command.destroyvehicle" access="false"> "command.customize" access="false"> "command.setcolor" access="false"> "command.setpaintjob" access="false"> "command.listmessages" access="false"> "command.readmessage" access="false"> "command.listresources" access="false"> "command.start" access="false"> "command.stop" access="false"> "command.stopall" access="false"> "command.restart" access="false"> "command.execute" access="false"> "command.setpassword" access="false"> "command.setwelcome" access="false"> "command.setgame" access="false"> "command.setmap" access="false"> "command.setweather" access="false"> "command.blendweather" access="false"> "command.setblurlevel" access="false"> "command.setwaveheight" access="false"> "command.setskygradient" access="false"> "command.setgamespeed" access="false"> "command.setgravity" access="false"> "command.settime" access="false"> "command.ban" access="false"> "command.unban" access="false"> "command.banip" access="false"> "command.unbanip" access="false"> "command.banserial" access="false"> "command.unbanserial" access="false"> "command.listbans" access="false"> "command.blow" access="false"> "command.destroy" access="false"> "command.setnick" access="false"> "command.delete" access="false"> "function.shutdown" access="false"> "command.setfpslimit" access="false"> "command.fetchRemote" access="false"> Link to comment
shoBy Posted September 1, 2014 Author Share Posted September 1, 2014 What do you made new in this commands ? I need to make for default group, too. Link to comment
xeon17 Posted September 1, 2014 Share Posted September 1, 2014 What do you made new in this commands ?I need to make for default group, too. Nothing , i just posted the VIP ACL You use.. Dude , first i no understand what you want? To remove a right just remove it ! or set it to false ! Link to comment
shoBy Posted September 1, 2014 Author Share Posted September 1, 2014 (edited) Man, my superman plugin...: All players have access to /superman and I don't want it. That's what I want... I seted this: <acl name="Default"> <right name="command.superman" access="false" /> <right name="superman" access="false"></right> In acl.xml, and nothing anywhere! Edited September 1, 2014 by Guest Link to comment
xeon17 Posted September 1, 2014 Share Posted September 1, 2014 This have nothing with ACL , post the superman script here.. Link to comment
shoBy Posted September 1, 2014 Author Share Posted September 1, 2014 Client.lua -- Copyright (c) 2008, Alberto Alonso -- -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without modification, -- are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, this -- list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright notice, this -- list of conditions and the following disclaimer in the documentation and/or other -- materials provided with the distribution. -- * Neither the name of the superman script nor the names of its contributors may be used -- to endorse or promote products derived from this software without specific prior -- written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. local Superman = {} -- Settings local ZERO_TOLERANCE = 0.00001 local MAX_ANGLE_SPEED = 6 -- In degrees per frame local MAX_SPEED = 1.0 local EXTRA_SPEED_FACTOR = 1.85 local LOW_SPEED_FACTOR = 0.40 local ACCELERATION = 0.025 local EXTRA_ACCELERATION_FACTOR = 1.8 local LOW_ACCELERATION_FACTOR = 0.85 local TAKEOFF_VELOCITY = 1.75 local TAKEOFF_FLIGHT_DELAY = 750 local SMOKING_SPEED = 1.25 local GROUND_ZERO_TOLERANCE = 0.18 local LANDING_DISTANCE = 3.2 local FLIGHT_ANIMLIB = "swim" local FLIGHT_ANIMATION = "Swim_Dive_Under" local FLIGHT_ANIM_LOOP = false local IDLE_ANIMLIB = "cop_ambient" local IDLE_ANIMATION = "Coplook_loop" local IDLE_ANIM_LOOP = true local MAX_Y_ROTATION = 55 local ROTATION_Y_SPEED = 3.8 -- Static global variables local thisResource = getThisResource() local rootElement = getRootElement() local localPlayer = getLocalPlayer() local serverGravity = getGravity() -- -- Utility functions -- local function isPlayerFlying(player) local data = getElementData(player, "superman:flying") if not data or data == false then return false else return true end end local function setPlayerFlying(player, state) if state == true then state = true else state = false end setElementData(player, "superman:flying", state) end local function iterateFlyingPlayers() local current = 1 local allPlayers = getElementsByType("player") return function() local player repeat player = allPlayers[current] current = current + 1 until not player or (isPlayerFlying(player) and isElementStreamedIn(player)) return player end end function Superman:restorePlayer(player) setPlayerFlying(player, false) setPedAnimation(player, false) setElementVelocity(player, 0, 0, 0) setElementRotation(player, 0, 0, 0) --setPedRotation(player, getPedRotation(player)) setElementCollisionsEnabled(player, true) self:destroySmokeGenerators(player) self.rotations[player] = nil self.previousVelocity[player] = nil end function Superman:createSmokeGenerator(player) local generator = createObject(2780, getElementPosition(player)) setElementCollisionsEnabled(generator, false) setObjectScale(generator, 0) return generator end function Superman:createSmokeGenerators(player) if not self.smokeGenerators[player] then local smokeGenerators = {} smokeGenerators[1] = self:createSmokeGenerator(player) attachElementToElement(smokeGenerators[1], player, 0.75, -0.2, -0.4, -40, 0, 60) smokeGenerators[2] = self:createSmokeGenerator(player) attachElementToElement(smokeGenerators[2], player, -0.75, -0.2, -0.4, -40, 0, -60) self.smokeGenerators[player] = smokeGenerators end end function Superman:destroySmokeGenerators(player) if self.smokeGenerators[player] then for k, v in ipairs(self.smokeGenerators[player]) do destroyElement(v) end self.smokeGenerators[player] = nil end end function angleDiff(angle1, angle2) angle1, angle2 = angle1 % 360, angle2 % 360 local diff = (angle1 - angle2) % 360 if diff <= 180 then return diff else return -(360 - diff) end end local function isPedInWater(ped) local pedPosition = Vector3D:new(getElementPosition(ped)) if pedPosition.z <= 0 then return true end local waterLevel = getWaterLevel(pedPosition.x, pedPosition.y, pedPosition.z) if not isElementStreamedIn(ped) or not waterLevel or waterLevel < pedPosition.z then return false else return true end end local function isnan(x) math.inf = 1/0 if x == math.inf or x == -math.inf or x ~= x then return true end return false end local function getVector2DAngle(vec) if vec.x == 0 and vec.y == 0 then return 0 end local angle = math.deg(math.atan(vec.x / vec.y)) + 90 if vec.y < 0 then angle = angle + 180 end return angle end -- -- Initialization and shutdown functions -- function Superman.Start() local self = Superman -- Register events addEventHandler("onClientResourceStop", getResourceRootElement(thisResource), Superman.Stop, false) addEventHandler("onPlayerJoin", rootElement, Superman.onJoin) addEventHandler("onPlayerQuit", rootElement, Superman.onQuit) addEventHandler("onClientRender", rootElement, Superman.processControls) addEventHandler("onClientRender", rootElement, Superman.processFlight) addEventHandler("onClientPlayerDamage", localPlayer, Superman.onDamage, false) addEventHandler("onClientElementDataChange", rootElement, Superman.onDataChange) addEventHandler("onClientElementStreamIn", rootElement, Superman.onStreamIn) addEventHandler("onClientElementStreamOut", rootElement, Superman.onStreamOut) -- Bind keys bindKey("jump", "down", Superman.onJump) -- Register commands addCommandHandler("superman", Superman.cmdSuperman) -- Initializate attributes self.smokeGenerators = {} self.rotations = {} self.previousVelocity = {} end addEventHandler("onClientResourceStart", getResourceRootElement(thisResource), Superman.Start, false) function Superman.Stop() local self = Superman setGravity(serverGravity) -- Restore all players animations, collisions, etc for player in iterateFlyingPlayers() do self:restorePlayer(player) end end -- -- Join/Quit -- function Superman.onJoin(player) local self = Superman local player = player or source setPlayerFlying(player, false) end function Superman.onQuit(reason, player) local self = Superman local player = player or source if isPlayerFlying(player) then self:restorePlayer(player) end end -- -- onDamage: superman is invulnerable -- function Superman.onDamage() local self = Superman if isPlayerFlying(localPlayer) then cancelEvent() end end -- -- onStreamIn: Reset rotation attribute for player -- function Superman.onStreamIn() local self = Superman end Link to comment
xeon17 Posted September 1, 2014 Share Posted September 1, 2014 Client: -- Copyright (c) 2008, Alberto Alonso -- -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without modification, -- are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, this -- list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright notice, this -- list of conditions and the following disclaimer in the documentation and/or other -- materials provided with the distribution. -- * Neither the name of the superman script nor the names of its contributors may be used -- to endorse or promote products derived from this software without specific prior -- written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. local Superman = {} function canceldamage() cancelEvent() end addEventHandler("onClientPedDamage", getRootElement(), canceldamage) -- Settings local ZERO_TOLERANCE = 0.00001 local MAX_ANGLE_SPEED = 6 -- In degrees per frame local MAX_SPEED = 1.0 local EXTRA_SPEED_FACTOR = 1.85 local LOW_SPEED_FACTOR = 0.40 local ACCELERATION = 0.025 local EXTRA_ACCELERATION_FACTOR = 1.8 local LOW_ACCELERATION_FACTOR = 0.85 local TAKEOFF_VELOCITY = 1.75 local TAKEOFF_FLIGHT_DELAY = 750 local SMOKING_SPEED = 1.25 local GROUND_ZERO_TOLERANCE = 0.18 local LANDING_DISTANCE = 3.2 local FLIGHT_ANIMLIB = "swim" local FLIGHT_ANIMATION = "Swim_Dive_Under" local FLIGHT_ANIM_LOOP = false local IDLE_ANIMLIB = "cop_ambient" local IDLE_ANIMATION = "Coplook_loop" local IDLE_ANIM_LOOP = true local MAX_Y_ROTATION = 55 local ROTATION_Y_SPEED = 3.8 -- Static global variables local thisResource = getThisResource() local rootElement = getRootElement() local localPlayer = getLocalPlayer() local serverGravity = getGravity() -- -- Check for admin -- function canFly() return getElementData(localPlayer, "canFly") end -- -- Utility functions -- local function isPlayerFlying(player) local data = getElementData(player, "superman:flying") if not data or data == false then return false else return true end end local function setPlayerFlying(player, state) if state == true then state = true else state = false end setElementData(player, "superman:flying", state) end local function iterateFlyingPlayers() local current = 1 local allPlayers = getElementsByType("player") return function() local player repeat player = allPlayers[current] current = current + 1 until not player or (isPlayerFlying(player) and isElementStreamedIn(player)) return player end end function Superman:restorePlayer(player) setPlayerFlying(player, false) setPedAnimation(player, false) setElementVelocity(player, 0, 0, 0) setElementRotation(player, 0, 0, 0) --setPedRotation(player, getPedRotation(player)) setElementCollisionsEnabled(player, true) self:destroySmokeGenerators(player) self.rotations[player] = nil self.previousVelocity[player] = nil end function Superman:createSmokeGenerator(player) local generator = createObject(2780, getElementPosition(player)) setElementCollisionsEnabled(generator, false) setObjectScale(generator, 0) return generator end function Superman:createSmokeGenerators(player) if not self.smokeGenerators[player] then local smokeGenerators = {} smokeGenerators[1] = self:createSmokeGenerator(player) attachElements(smokeGenerators[1], player, 0.75, -0.2, -0.4, -40, 0, 60) smokeGenerators[2] = self:createSmokeGenerator(player) attachElements(smokeGenerators[2], player, -0.75, -0.2, -0.4, -40, 0, -60) self.smokeGenerators[player] = smokeGenerators end end function Superman:destroySmokeGenerators(player) if self.smokeGenerators[player] then for k, v in ipairs(self.smokeGenerators[player]) do destroyElement(v) end self.smokeGenerators[player] = nil end end function angleDiff(angle1, angle2) angle1, angle2 = angle1 % 360, angle2 % 360 local diff = (angle1 - angle2) % 360 if diff <= 180 then return diff else return -(360 - diff) end end local function isElementInWater(ped) local pedPosition = Vector3D:new(getElementPosition(ped)) if pedPosition.z <= 0 then return true end local waterLevel = getWaterLevel(pedPosition.x, pedPosition.y, pedPosition.z) if not isElementStreamedIn(ped) or not waterLevel or waterLevel < pedPosition.z then return false else return true end end local function isnan(x) math.inf = 1/0 if x == math.inf or x == -math.inf or x ~= x then return true end return false end local function getVector2DAngle(vec) if vec.x == 0 and vec.y == 0 then return 0 end local angle = math.deg(math.atan(vec.x / vec.y)) + 90 if vec.y < 0 then angle = angle + 180 end return angle end -- -- Initialization and shutdown functions -- function Superman.Start() local self = Superman -- Register events addEventHandler("onClientResourceStop", getResourceRootElement(thisResource), Superman.Stop, false) addEventHandler("onPlayerJoin", rootElement, Superman.onJoin) addEventHandler("onPlayerQuit", rootElement, Superman.onQuit) addEventHandler("onClientRender", rootElement, Superman.processControls) addEventHandler("onClientRender", rootElement, Superman.processFlight) addEventHandler("onClientPlayerDamage", localPlayer, Superman.onDamage, false) addEventHandler("onClientElementDataChange", rootElement, Superman.onDataChange) addEventHandler("onClientElementStreamIn", rootElement, Superman.onStreamIn) addEventHandler("onClientElementStreamOut", rootElement, Superman.onStreamOut) -- Bind keys bindKey("jump", "down", Superman.onJump) -- Register commands addCommandHandler("superman", Superman.cmdSuperman) -- Initializate attributes self.smokeGenerators = {} self.rotations = {} self.previousVelocity = {} end addEventHandler("onClientResourceStart", getResourceRootElement(thisResource), Superman.Start, false) function Superman.Stop() local self = Superman setGravity(serverGravity) -- Restore all players animations, collisions, etc for player in iterateFlyingPlayers() do self:restorePlayer(player) end end -- -- Join/Quit -- function Superman.onJoin(player) local self = Superman local player = player or source setPlayerFlying(player, false) end function Superman.onQuit(reason, player) local self = Superman local player = player or source if isPlayerFlying(player) then self:restorePlayer(player) end end -- -- onDamage: superman is invulnerable -- function Superman.onDamage() local self = Superman Link to comment
shoBy Posted September 1, 2014 Author Share Posted September 1, 2014 Thanks a lot man. What do you edited ? Another problem...Where should I edit to make the access for the Admin to the panel(admin panel)? Link to comment
shoBy Posted September 1, 2014 Author Share Posted September 1, 2014 Here is the panel: http://www.myuplbox.com/file/download/1176232 Please help me :o3 Link to comment
shoBy Posted September 1, 2014 Author Share Posted September 1, 2014 Here is the panel: http://www.myuplbox.com/file/download/1176232 Please help me :o3 Only Admin rank, same superman. Link to comment
xeon17 Posted September 1, 2014 Share Posted September 1, 2014 Stop double posting , just edit your last post. Where should I edit to make the access for the Admin to the panel(admin panel)? You want to add a button in admin panel for superman? I really no understand you. use GuiCreateButton Link to comment
shoBy Posted September 1, 2014 Author Share Posted September 1, 2014 Eh...Sorry for bad english...But I want to have acces to the panel at ranks Moderator SuperModerator Admin Co-Owner Owner...Just this ranks to have acces to press p for the panel. Sorry for double post, I didn't know. EDIT: Only that 5 ranks, I want to have access to the admin panel. The rest of admins will have commands in chat. Like /mute or anything. Link to comment
xeon17 Posted September 1, 2014 Share Posted September 1, 2014 Just remove the following function from the ACL's then they can't use the admin panel. <right name="general.adminpanel" access="false"></right> Link to comment
shoBy Posted September 1, 2014 Author Share Posted September 1, 2014 I have a problem. At superman, I don't have acces at superman at ranks Co-Owner and Owner, just at admin ) Where should I edit in there ? In server.lua addEventHandler("onPlayerLogin", root, function(_, account) if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup("Admin")) then setElementData(source, "canFly", true) end Only this ? Link to comment
xeon17 Posted September 1, 2014 Share Posted September 1, 2014 To make it easier i'll create a table with acl groups for you. line 29 -- Copyright (c) 2008, Alberto Alonso -- -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without modification, -- are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, this -- list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright notice, this -- list of conditions and the following disclaimer in the documentation and/or other -- materials provided with the distribution. -- * Neither the name of the superman script nor the names of its contributors may be used -- to endorse or promote products derived from this software without specific prior -- written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. local groups = { "group1", "group2", "group3" } local Superman = {} -- Static global values local rootElement = getRootElement() local thisResource = getThisResource() -- Resource events addEvent("superman:start", true) addEvent("superman:stop", true) -- -- Start/stop functions -- function Superman.Start() local self = Superman addEventHandler("superman:start", rootElement, self.clientStart) addEventHandler("superman:stop", rootElement, self.clientStop) end addEventHandler("onResourceStart", getResourceRootElement(thisResource), Superman.Start, false) function Superman.clientStart() setElementData(client, "superman:flying", true) setElementData(client, "forcedanimation", true) end function Superman.clientStop() removeElementData(client, "superman:flying") removeElementData(client, "forcedanimation") end addEventHandler("onPlayerLogin", root, function ( _,account ) local account = getPlayerAccount(source) if (not account or isGuestAccount(account)) then return end local accountName = getAccountName(account) for i, v in pairs ( groups ) do if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( v ) ) ) then setElementData(source, "canFly", true) end end end end) Link to comment
shoBy Posted September 1, 2014 Author Share Posted September 1, 2014 group1 is like Co-Owner group2 is like Owner ? and group3 like...another rank >? Link to comment
xeon17 Posted September 1, 2014 Share Posted September 1, 2014 Replace group1,group2,group3 with your acl groups.. 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