Jump to content

Puas/Aguijon no pinchan


LatinNetworks

Recommended Posts

Si quieres que las púas pinchen las ruedas de los autos creo que una forma de hacerlo seria crear una colshape con la posición del objeto y cuando un auto entre, usas esto: set

setVehicleWheelState

No sé si esa era la función pero sé que había una que cambiaba el estado de las ruedas, buscala

Edited by Anzo
Link to comment

Te dejo un trozo de un script que hace lo que buscas (hay partes que no te servirán y será necesario que las borres).


addCommandHandler ("strip",
    function ( player )
        if ( isElement(spike [ player ])) then return end
        local div = exports.GTIemployment:getPlayerJobDivision(player)
        if ( player and not isPedInVehicle ( player ) and div == "Highway Patrol" and isPedOnGround ( player ) and getElementDimension ( player ) == 0 and stingers == false ) then
        local x, y, z = getElementPosition ( player )
        local xr, yr, zr = getElementRotation ( player )
        spike [ player ] = createObject ( 2899, x, y, z-0.875, xr, yr, zr )
	owner[spike] = player
        exports.GTIanims:setJobAnimation(player, "BOMBER", "BOM_Plant", 2500, false, false, true, false )
        destroySpike = setTimer ( destroySpikes, 180000, 1, player )
        local x2, y2, z2 = getElementPosition ( spike [ player ] )
        blow [ player ] =  createColSphere(x2, y2, z2,3)
	owner[ blow[player] ] = player
	local sx,sy,sz = getElementRotation(spike[player])
	setElementRotation(blow[player],sx,sy,sz)
	addEventHandler("onColShapeHit", blow[player], onHitTheStrip)
	addEventHandler("onColShapeLeave", blow[player], onLeaveTheStrip)
        addEventHandler ("onColShapeHit", blow [ player ], function ( player )
        if ( exports.GTIpoliceWanted:getPlayerWantedLevel ( player ) <=0 ) then return end
        if player and getElementType ( player ) == "player" then
            if isPedInVehicle ( player ) then
                local pveh = getPedOccupiedVehicle ( player )    
                setVehicleWheelStates ( pveh, 1, 1, 1, 1 )
                end
            end
        end)
    end
end)

 

Link to comment
  • Recently Browsing   0 members

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