Jump to content

¿Como puedo hacer que un vehiculo sea volador?


Diablomta

Recommended Posts

Se puede colocar un vehiculo volador?...

Quiero hacer que halla un vehiculo volador pero que no sea con ningun comando, solo cuando se suba y este listo empieze a arrancar y vuele.

Quiero hacer que el vehiculo Bullet sea el vehiculo volador. gracias por su ayuda!

Edited by Diablomta
Link to comment

Prueba

addEventHandler("onClientVehicleEnter", root, 
    function(player)
        if player == getLocalPlayer() then 
           local id = getElementModel(source)
           if id == 402 and not isWorldSpecialPropertyEnabled("aircars")  then 
              setWorldSpecialPropertyEnabled( "aircars", true )
           end
        end
    end 
)

 

Link to comment
addEventHandler("onClientVehicleEnter", root, 
    function(player)
        if player == getLocalPlayer() then 
           local id = getElementModel(source)
           if id == 402 and not isWorldSpecialPropertyEnabled("aircars")  then 
              setWorldSpecialPropertyEnabled( "aircars", true )
           end
        end
    end 
)

addEventHandler("onClientVehicleExit", root, 
    function(player)
        if player == getLocalPlayer() then 
           local id = getElementModel(source)
           if id == 402 and isWorldSpecialPropertyEnabled("aircars")  then 
              setWorldSpecialPropertyEnabled( "aircars", false )
           end
        end
    end 
)

 

Link to comment

Algo asi?

addEventHandler("onElementDestroy", getRootElement(), function ()
  if getElementType(source) == "vehicle" then
    local nPassengers = getVehicleMaxPassengers(source)
    local id = getElementModel(source)
    for i=0,nPassengers-1 do
      local occupant = getVehicleOccupant(source, i)
      if occupant then
      if id == 506 and isWorldSpecialPropertyEnabled("aircars")  then
         setWorldSpecialPropertyEnabled( "aircars", false )
        outputChatBox("The vehicle that you were in has been destroyed by the script", occupant)
      end
    end
  end
end

Link to comment

Te faltó un end y cerrar el evento, pero el evento es sólo "server-side", tendrías que triggear

addEventHandler("onElementDestroy", getRootElement(), 
	function ()
		if getElementType(source) == "vehicle" then
			local nPassengers = getVehicleMaxPassengers(source)
			local id = getElementModel(source)
			for i=0,nPassengers-1 do
				local occupant = getVehicleOccupant(source, i)
				if occupant then
					if id == 506 then
						--triggerClientEvent()
						outputChatBox("The vehicle that you were in has been destroyed by the script", occupant)
					end
				end
			end
		end
	end
)

 

Edited by #Dv^
Link to comment

Em sí, si se puede si haces el trigger cómo te lo dije anteriormente

15 minutes ago, #Dv^ said:

Te faltó un end y cerrar el evento, pero el evento es sólo "server-side", tendrías que triggear


addEventHandler("onElementDestroy", getRootElement(), 
	function ()
		if getElementType(source) == "vehicle" then
			local nPassengers = getVehicleMaxPassengers(source)
			local id = getElementModel(source)
			for i=0,nPassengers-1 do
				local occupant = getVehicleOccupant(source, i)
				if occupant then
					if id == 506 then
						--triggerClientEvent()
						outputChatBox("The vehicle that you were in has been destroyed by the script", occupant)
					end
				end
			end
		end
	end
)

 

 

Edited by #Dv^
Link to comment
  • Recently Browsing   0 members

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