Jump to content

Admin jetpack


Behnam

Recommended Posts

    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
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 !

Link to comment
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 by Erknneto
Link to comment
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 ?

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...