Behnam Posted July 26, 2018 Share Posted July 26, 2018 Hi all. Please give me a jetpack for admin acl group ! bindKey : j hide and show jetpack with bind Thanks. Link to comment
DiGiTal Posted July 26, 2018 Share Posted July 26, 2018 function jetpack( thePlayer ) if doesPedHaveJetPack ( thePlayer ) then -- If the player have a jetpack already, remove it removePedJetPack ( thePlayer ) -- Remove the jetpack return -- And stop the function here end -- Otherwise, give him one if he has access local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then -- Does he have access to Admin functions? if not doesPedHaveJetPack ( thePlayer ) then -- If the player doesn't have a jetpack give it. givePedJetPack ( thePlayer ) -- Give the jetpack end end end bindKey ( thePlayer, "j", "down", jetpack) @Behnam Link to comment
Behnam Posted July 27, 2018 Author Share Posted July 27, 2018 On 26/07/2018 at 22:33, DiGiTal said: function jetpack( thePlayer ) if doesPedHaveJetPack ( thePlayer ) then -- If the player have a jetpack already, remove it removePedJetPack ( thePlayer ) -- Remove the jetpack return -- And stop the function here end -- Otherwise, give him one if he has access local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then -- Does he have access to Admin functions? if not doesPedHaveJetPack ( thePlayer ) then -- If the player doesn't have a jetpack give it. givePedJetPack ( thePlayer ) -- Give the jetpack end end end bindKey ( thePlayer, "j", "down", jetpack) @Behnam Expand Not Work ! Link to comment
Erknneto Posted July 27, 2018 Share Posted July 27, 2018 (edited) function setJetpack (source) local acc = getAccountName(getPlayerAccount(source)) if ( isObjectInACLGroup("user."..acc,aclGetGroup("Admin")) ) then if ( doesPedHaveJetPack(source) ) then removePedJetPack(source) return end givePedJetPack(source) end end addEventHandler("onPlayerJoin",getRootElement(),function() bindKey(source,"J","down",setJetpack) end) try this one Edited July 27, 2018 by Erknneto Link to comment
Behnam Posted July 27, 2018 Author Share Posted July 27, 2018 On 27/07/2018 at 01:28, Erknneto said: function setJetpack (source) local acc = getAccountName(getPlayerAccount(source)) if ( isObjectInACLGroup("user."..acc,aclGetGroup("Admin")) ) then if ( doesPedHaveJetPack(source) ) then removePedJetPack(source) return end givePedJetPack(source) end end addEventHandler("onPlayerJoin",getRootElement(),function() bindKey(source,"J","down",setJetpack) end) try this one Expand Server side ? Link to comment
Erknneto Posted July 27, 2018 Share Posted July 27, 2018 On 27/07/2018 at 01:31, Behnam said: Server side ? Expand Yes Link to comment
Behnam Posted July 27, 2018 Author Share Posted July 27, 2018 On 27/07/2018 at 01:33, Erknneto said: Yes Expand Not Work ! Link to comment
Erknneto Posted July 27, 2018 Share Posted July 27, 2018 You know the bind will only be set if the player joins the server, right? Try to reconnect and check if the bind works. Or check the debugscript to see if any errors appears. 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