giampa Posted June 23, 2012 Posted June 23, 2012 c' è per caso uno script che rende invisibili tutti gli oggetti con quei determinati ID? io ho trovato un modo(ovvero retexturizzando gli oggetti con una texture trasparente) ma mi chiedevo se era possibile farlo in un altro modo...
HunT Posted June 24, 2012 Posted June 24, 2012 Semplice. Basta creare un table con i relativi ID che vuo fare trasparenti ed usare setElementAlpha con il value 0 Da 1 a 0 Purtroppo non ho ne MTA e ne pc per farti un esempio. Cmq mettiamo caso che il table lo chiami "tavolo" quindi fai . . setElementAlpha (tavolo, 0 ) in modo da avere tutti gli ID nel table trasparenti. Puoi usare questa funzione con un comando o un evento. Se hai altro da chiedere sei il benvenuto.
giampa Posted June 25, 2012 Author Posted June 25, 2012 scusa poniamo il caso che voglio rendere trasparenti gli oggetti con id3458 , vgncarshade1.dff , e idk.txd function nomefunzione() ??? end bindKey ( "l", "down", nomefunzione) come dovrò procedere?
HunT Posted June 26, 2012 Posted June 26, 2012 Allora. . . prima di tutto e meglio che usi createObject. Quindi fai. function objectinvisible () oggetto1 = createObject (3458, x, y, z, rx, ry, rz ) setElementAlpha (oggetto1, 0 ) end addEventHandler ( "onResourceStart", getRootElement(), objectinvisible) Se hai ad esempio 5 o 6 oggetti da fare trasparenti non hai bisogno del table,se ne hai parecchi allora si. L'evento che ho messo funziona sia per una mappa oppure quando fai partire la script. Se hai ad esempio 3 oggetti fai oggetto1 = createObject (id oggetto,coordinate x y z rx ry rs ) oggetto2 = ....... oggetto3 = ........ setElementAlpha (oggetto1, 0) setEle ...... (oggetto2, 0) E penso esser stato chiaro.
giampa Posted June 26, 2012 Author Posted June 26, 2012 sei stato chiarissimo... mi hai spiegato come creare oggetto x oggetto e poi farlo diventare trasparente.. ma quello che volevo sapere era se c era qualche modo per rendere tutti gli oggetti con quello id trasparenti senza ricorrere alla retexturizzazione
HunT Posted June 26, 2012 Posted June 26, 2012 function trasparenzaTotale ( tutti3458 ) if ( getElementType ( tutti3458 ) == "object" ) and ( getElementModel ( tutti3458 ) == 3458 ) setElementAlpha (tutti3458, 0 ) end end addEventHandler ( "onResourceStart", getRootElement(), trasparenzaTotale ) Prova quest client-side. (tieni presente che rispondo con l iPhone e non posso testare nulla) Facci sapere.
xShocKz Posted June 26, 2012 Posted June 26, 2012 esistono anche tool facili da usare... come questo https://community.multitheftauto.com/index.php?p= ... ls&id=3595
HunT Posted June 27, 2012 Posted June 27, 2012 esistono anche tool facili da usare... come questo https://community.multitheftauto.com/index.php?p= ... ls&id=3595 Alla fine è lo stesso procedimento shokkino. Una script di 7 righe ed è fatta. Per di più usando la mia soluzione si impara anche a capire il Lua, e non limitandosi SEMPRE ad usare la roba degli altri. Amen.
giampa Posted June 28, 2012 Author Posted June 28, 2012 @Shock lo conoscevo già @Hunterix.. non ho capito bene? help me pls
HunT Posted June 28, 2012 Posted June 28, 2012 function trasparenzaTotale ( tutti3458 ) if ( getElementType ( tutti3458 ) == "object" ) and ( getElementModel ( tutti3458 ) == 3458 ) setElementAlpha (tutti3458, 0 ) end end addEventHandler ( "onResourceStart", getRootElement(), trasparenzaTotale ) Fai un file tipo trasp.lua e non dimenticare di metterlo nel meta. Script SRC trasp.lua type client Fai partire la script o la mappa.Se non funziona scrivi in chat: /debugscript 3 Ti appare una finestra sotto,riporta cosa dice in caso non funzioni.
giampa Posted June 30, 2012 Author Posted June 30, 2012 warning:loadingscriptfailed editor_test/client.lua:4:then expected near 'setElementAlpha'
HunT Posted June 30, 2012 Posted June 30, 2012 function trasparenzaTotale ( tutti3458 ) if ( getElementType ( tutti3458 ) == "object" ) and ( getElementModel ( tutti3458 ) == 3458 ) then setElementAlpha (tutti3458, 0 ) end end addEventHandler ( "onResourceStart", getRootElement(), trasparenzaTotale ) Avevo dimenticato il then Il debugscript è fedele.
HunT Posted July 3, 2012 Posted July 3, 2012 ancora bug come gia detto non ho ne mta ne pc per testare la script,se mi dici almeno l errore.
giampa Posted July 6, 2012 Author Posted July 6, 2012 Error: NOMEMAPPA/client.lua:72:attempt to call global 'setcloudenabled' (a nil value) Error: NOMEMAPPA/client.lua:72:attempt to call global 'setcloudenabled' (a nil value) l errore non me lo da in quella parte, ma in un altra parte dello script....intanto gli oggetti non sono trasparenti
HunT Posted July 7, 2012 Posted July 7, 2012 Error: NOMEMAPPA/client.lua:72:attempt to call global 'setcloudenabled' (a nil value)Error: NOMEMAPPA/client.lua:72:attempt to call global 'setcloudenabled' (a nil value) l errore non me lo da in quella parte, ma in un altra parte dello script....intanto gli oggetti non sono trasparenti Se hai altri errori e logico che non funziona la script che ti ho fatto:/ Che cazzo c'entra set cloude enable con la mia script.
HunT Posted July 7, 2012 Posted July 7, 2012 Anyway posta qui l'intera script e la fixiamo. L errore che dice nel set cloude e che non hai messo il true o il false,sta aspettando il value
giampa Posted July 15, 2012 Author Posted July 15, 2012 ---no lag--- function trasparenzaTotale ( tutti3458 ) if ( getElementType ( tutti3458 ) == "object" ) and ( getElementModel ( tutti3458 ) == 3458 ) then setElementAlpha (tutti3458, 0 ) end end addEventHandler ( "onResourceStart", getRootElement(), trasparenzaTotale ) ---qua devo fare bind key etc.. --- ---marker script--- jump1 = createMarker(3146.2739257813, -604.94769287109, 5.5285000801086, "corona", 8, 0, 255, 255, 0) jump2 = createMarker(5136.1787109375, -525, 3, "cylinder", 10, 0, 255, 255, 0) function jumps(player) if getElementType(player)=="player" then local vehicle = getPedOccupiedVehicle(player) if source == jump1 then setElementVelocity(vehicle, 1, 0, 0.15) setElementRotation(vehicle, 0, 0, 270) end end if getElementType(player)=="player" then local vehicle = getPedOccupiedVehicle(player) if source == jump2 then setElementVelocity(vehicle, 0.3, -1.5, 1.3) end end ---end of function, now--- end addEventHandler("onClientMarkerHit", resourceRoot, jumps) ---retexture--- function retexture () --- news palm model--- palmtxd = engineLoadTXD("gta_tree_palm.txd") engineImportTXD(palmtxd, 622 ) local palmdff = engineLoadDFF('veg_palm03.dff', 0) engineReplaceModel(palmdff, 622) palmtxd2 = engineLoadTXD("gta_tree_palm.txd") engineImportTXD(palmtxd2, 710 ) local palmdff2 = engineLoadDFF('vgs_palm01.dff', 0) engineReplaceModel(palmdff2, 710) ---invisiblepartinseaobject--- invisiblepart = engineLoadTXD("cs_coast.txd") engineImportTXD(invisiblepart, 18350 ) end addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), retexture ) ---chat,water sky--- outputChatBox ("", 255, 255, 255, true) outputChatBox ("", 255, 255, 255, true) outputChatBox ("", 255, 255, 255, true) outputChatBox ("", 255, 255, 255, true) outputChatBox ("", 255, 255, 255, true) outputChatBox ("", 255, 255, 255, true) outputChatBox ("pvo", 255, 255, 255, true) setWaterColor(0, 210, 210, 256) setSkyGradient( 0, 250, 250, 150, 250, 250 ) ---no clouds--- setCloudEnabled ( false )
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now