Behnam Posted July 26, 2018 Posted July 26, 2018 Hi all. Please give me a jetpack for admin acl group ! bindKey : j hide and show jetpack with bind Thanks.
DiGiTal Posted July 26, 2018 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
Behnam Posted July 27, 2018 Author Posted July 27, 2018 2 hours ago, 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 Not Work !
Erknneto Posted July 27, 2018 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
Behnam Posted July 27, 2018 Author Posted July 27, 2018 2 minutes ago, 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 Server side ?
Erknneto Posted July 27, 2018 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.
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