Jump to content

Comando /superman


Recommended Posts

Opa alguem poderia me ajudar com esse script de voar? Eu gostaria que ele so funcionasse com a STAFF so que todos os players estao podendo utilizar ele.

local conta = getAccountName (getPlayerAccount(thePlayer))
    if not isObjectInACLGroup ( "user." .. conta, aclGetGroup ( "Ajudante" ) ) then outputChatBox("Permissão negada!",thePlayer,255) return end
local Superman = {}


local rootElement = getRootElement()
local thisResource = getThisResource()

addEvent("superman:start", true)
addEvent("superman:stop", true)


function Superman.Start()

  local self = Superman

  addEventHandler("superman:start", rootElement, self.clientStart)
  addEventHandler("superman:stop", rootElement, self.clientStop)
  addEventHandler("onPlayerVehicleEnter",rootElement,self.enterVehicle)
end
addEventHandler("onResourceStart", getResourceRootElement(thisResource), Superman.Start, false)

function Superman.clientStart()
  setElementData(client, "superman:flying", true)
end

function Superman.clientStop()
  setElementData(client, "superman:flying", false)
end


function cancelAirkill()
    if getElementData(source,"superman:flying") or getElementData(source,"superman:takingOff") then
        cancelEvent()
    end
end
addEventHandler("onPlayerStealthKill", getRootElement(),cancelAirkill)


function Superman.enterVehicle()
	if getElementData(source,"superman:flying") or getElementData(source,"superman:takingOff") then
		removePedFromVehicle(source)
		local x,y,z = getElementPosition(source)
		setElementPosition(source,x,y,z)
	end
end

 

Link to comment
  • Other Languages Moderators

De acordo com o código, somente os Ajudantes estão sendo proibidos de usar.

Eu trocaria sua segunda linha por essa:

if not hasObjectPermissionTo (thePlayer, "command.mute", false) then outputChatBox ("Permissão negada!", thePlayer, 255, 0, 0) return end

Se o jogador não tiver permissão para mutar outros jogadores, então manda a mensagem pra ele e nada acontece. Dessa forma, todo o Staff (jogadores com permissão de mutar) terão acesso.

  • Thanks 2
Link to comment
  • 1 month later...

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