Xwad Posted December 28, 2014 Share Posted December 28, 2014 Hi i downloaded the Overdose effects and put it in Gameplay folder and create a meta file and wrote this But when i started my server it does not work:( Link to comment
MTA Team botder Posted December 28, 2014 MTA Team Share Posted December 28, 2014 It doesn't work this way. Your 'meta.xml' only tells the server to transfer the files to each client (and the client does nothing with them). Link to comment
Xwad Posted December 28, 2014 Author Share Posted December 28, 2014 Then what should i do? download another effects? Link to comment
MTA Team botder Posted December 29, 2014 MTA Team Share Posted December 29, 2014 Resources won't replace the files when you only let the players download the files. Resources are small programms/modules and as a scripter you have to make them also replace the GTA files. Link to comment
Xwad Posted December 29, 2014 Author Share Posted December 29, 2014 ööö ok but what should i do then? Link to comment
MTA Team botder Posted December 29, 2014 MTA Team Share Posted December 29, 2014 Warning: I forgot that particles might not have a model id, which you can replace (others please report your knowledge) and it might be only possible with shaders? You probably can't replace .fxp files, but you can replace .txd files (. Your resource needs a clientside script (that script will be downloaded by every player [automatically] and it will be run on the MTA client). Let's call this script client.lua (place it in your resource folder) Your server needs to know that it should transfer the client.lua to each client. To archive that you have to add the script to your meta.xml <meta> <info author="Xwad" /> <file src="effects.fxp" /> <file src="effectsPC.txd" /> <file src="particle.txd" /> <script src="client.lua" /> </meta> So far so good, but the clientscript is empty. Now to replace the files you have to use those functions when the resource starts: engineLoadTXD engineImportTXD But how do you know when a resource actually starts? For that purpose you have to use the event system. function whenMyResourceStarts() -- Probably not possible, because particles might not have a special model id (i don't know, lol) local txd = engineLoadTXD( "effectsPC.txd" ) engineImportTXD( txd, 1 ) txd = engineLoadTXD( "particle.txd" ) engineImportTXD( txd, 1 ) end addEventHandler("onClientResourceStart", resourceRoot, whenMyResourceStarts) Link to comment
Xwad Posted December 29, 2014 Author Share Posted December 29, 2014 Thanks i tryed to do that but it does now work:( i do something wrong. Can you make possibly that script for me? Link to comment
xeon17 Posted December 29, 2014 Share Posted December 29, 2014 I'm not sure if it's possible to change effects , but try this; 1. Login in your account (you need to be admin) 2. Open F8 and write "debugscript 3" 3. Restart the resource, and check does debugscript 3 output something about your resource. @EDIT: the functions engineLoadTXD and engineImportTXD work only for the gta3.img, effects are in models folder,so you can't change effects. Use shaders. Link to comment
MTA Team botder Posted December 29, 2014 MTA Team Share Posted December 29, 2014 Do effect texture names appear in the table from engineGetVisibleTextureNames? Link to comment
FuriouZ Posted December 29, 2014 Share Posted December 29, 2014 As far as I know, effects are only possible to change via shaders. Link to comment
lonew000lf Posted February 10, 2015 Share Posted February 10, 2015 Try this, replace the names. addEventHandler( "onClientResourceStart", resourceRoot, function() if getVersion ().sortable < "1.1.0" then outputChatBox( "resource wont work on this client." ) return end texShader = dxCreateShader ( "effects.fx" ) siteM16 = dxCreateTexture("hud/siteM16.png") dxSetShaderValue(texShader,"gTexture",siteM16) engineApplyShaderToWorldTexture(texShader,"siteM16") end ) Link to comment
-.Paradox.- Posted February 10, 2015 Share Posted February 10, 2015 Texture names used in GTA are the same as the used ones in MTA i guess Link to comment
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