andiyer Posted December 1, 2012 Share Posted December 1, 2012 Hola quiero saber como hacer para que el jetpack se pueda quitar y colocar en el aire cuando cae el jugador quitarlo y colocarselo repetitivamente Link to comment
AhmadQTR Posted December 1, 2012 Share Posted December 1, 2012 English please, search for your native language HERE Link to comment
Castillo Posted December 1, 2012 Share Posted December 1, 2012 Tema movido a Spanish > Scripting. Editando el script que te da el jetpack. Link to comment
andiyer Posted December 2, 2012 Author Share Posted December 2, 2012 y como ? ayudame please Link to comment
Castillo Posted December 2, 2012 Share Posted December 2, 2012 Anda a la carpeta de "mabako-services/server/shops.lua" y busca la funcion: "switchJetpack" y remplazala con esta: function switchJetpack( source ) if( doesPedHaveJetPack( source ) ) then removePedJetPack( source ) elseif( getElementData( source, "jetpackFuel" ) and getElementInterior( source ) == 0 ) then if( tonumber( getElementData( source, "jetpackFuel" ) ) > 1 ) then givePedJetPack( source ) end end end Luego anda a "mabako-services/client/jetpack_control.lua" y busca la funcion: "updateFuel" y remplazala con esta: function updateFuel( ) if( not getElementData( _local, "jetpackFuel" ) ) then return end local currentFuel = tonumber( getElementData( _local, "jetpackFuel" ) ) if( (getElementInterior( _local ) > 0 and guiGetVisible( jMenu ) ) or currentFuel == 0 ) then toggleJetpackWindow( false ) elseif( getElementInterior( _local ) == 0 and not guiGetVisible( jMenu ) ) then toggleJetpackWindow( true ) end if( doesPedHaveJetPack( _local ) ) then if( currentFuel > 0 ) then local veloX, veloY, veloZ = getElementVelocity( _local ) if( not veloX ) then return end if( veloZ < 0 ) then veloZ = 0 end -- literally going down is ignored, since you dont need fuel for that currentFuel = currentFuel - getDistanceBetweenPoints3D( veloX, veloY, veloZ, 0, 0, 0 ) * jetpackVeloMultiplier if( currentFuel < 1 ) then currentFuel = 0 end if( currentFuel == 0 ) then -- down, down, down toggleControl( "sprint", false ) setControlState( "jump", true ) outputChatBox( "Your JetPack ran out of fuel!", 255, 255, 0 ) end setElementData( _local, "jetpackFuel", currentFuel ) else if( currentFuel == 0 ) then triggerServerEvent( "forceJetpackRemove", _local ) end end end local shownValue = math.floor(currentFuel/jetpackMaxFuel*100) if( guiGetText( jText ) ~= shownValue .. "%" ) then guiProgressBarSetProgress( jBar, shownValue ) guiSetText( jText, shownValue .. "%" ) end end ADVERTENCIA: PUEDE QUE EL NOMBRE DEL RECURSO NO LO TENGAS COMO "mabako-services". Link to comment
andiyer Posted December 3, 2012 Author Share Posted December 3, 2012 Gracias men por tu ayuda te aghradesco men buena ayuda thanks you ! Link to comment
Recommended Posts