Arsilex Posted August 27, 2012 Share Posted August 27, 2012 Como aria para abrir todos los coches de 1 solo modelo osea poner /abrircoches y se abren los coches taxi o los que ponga alguen sabe? Link to comment
BorderLine Posted August 27, 2012 Share Posted August 27, 2012 abrir, te refieres a abrir las puertas? Link to comment
Arsilex Posted August 27, 2012 Author Share Posted August 27, 2012 si setVehicleLocked( vehicle, not isVehicleLocked( vehicle ) ) Link to comment
Tonyx97 Posted August 27, 2012 Share Posted August 27, 2012 Bueno prieba esto pekio: ServerSide function abrircars () Coches = getElementType ("vehicle") Id = getElementModel ( Coches ) if id == then setVehicleLocked ( Coches, false ) end end addCommandHandler ("abrircoches", abrircars) Link to comment
Alexs Posted August 27, 2012 Share Posted August 27, 2012 lo de Tonyx esta mal: function openall (player, comando, modelo) local models = getElementsByType("vehicle") for index, autos in pairs(models) do if ( getElementModel(autos) == tonumber(modelo)) then setVehicleLocked ( autos, false ) end end end addCommandHandler("abrircoches", openall) Espero este bien, luego usas el comando /openall [modelo] y se abren los de ese modelo. Link to comment
iFoReX Posted August 28, 2012 Share Posted August 28, 2012 Alexs el comando es /abrircoches MODELO Link to comment
Alexs Posted August 28, 2012 Share Posted August 28, 2012 Alexs el comando es /abrircoches MODELO Ahh si claro, lo confundi con mi funcion. Link to comment
Castillo Posted August 28, 2012 Share Posted August 28, 2012 function openall ( player, comando, modelo ) if ( tonumber ( modelo ) ) then for index, vehicle in ipairs ( getVehiclesOfType ( tonumber ( modelo ) ) ) do setVehicleLocked ( vehicle, false ) end end end addCommandHandler ( "abrircoches", openall ) Eso es mejor . Link to comment
Alexs Posted August 28, 2012 Share Posted August 28, 2012 function openall ( player, comando, modelo ) if ( tonumber ( modelo ) ) then for index, vehicle in ipairs ( getVehiclesOfType ( tonumber ( modelo ) ) ) do setVehicleLocked ( vehicle, false ) end end end addCommandHandler ( "abrircoches", openall ) Eso es mejor . Disculpa, solo por duda, el mio sirve? Link to comment
Castillo Posted August 28, 2012 Share Posted August 28, 2012 Si, el tuyo tambien deberia funcionar, pero creo que el mio es mas eficiente. Link to comment
Alexs Posted August 28, 2012 Share Posted August 28, 2012 Si, el tuyo tambien deberia funcionar, pero creo que el mio es mas eficiente. No conocía esa función, pero mientras el mio sirva, sigo bailando conga desnudo! Link to comment
Recommended Posts