Sergei- Posted May 9, 2013 Share Posted May 9, 2013 hi everyone,i learned how to mod cars,weapons,skins before a few days ago from you guys.do anyone know to change weapon sfx sound? if so please reply.thank you. Link to comment
iPrestege Posted May 9, 2013 Share Posted May 9, 2013 Please use the following : Event : onClientWeaponFire Function's : getElementPosition playSound3D That's what you have to use to make it And if you need any help just ask . Link to comment
Sergei- Posted May 9, 2013 Author Share Posted May 9, 2013 give me a example of meta.xml file and replace.lua file Link to comment
iPrestege Posted May 9, 2013 Share Posted May 9, 2013 (edited) For example : addEventHandler("onClientPlayerWeaponFire", getRootElement(), function ( weapon, ammo, ammoInClip ) local x,y,z = getElementPosition(source) if weapon == 30 then local sound = playSound3D("AK.mp3", x,y,z) setSoundMaxDistance(sound,75) end end ) Meta : Edited May 9, 2013 by Guest Link to comment
Sergei- Posted May 9, 2013 Author Share Posted May 9, 2013 we should put in the weapon resource file or a new file? Link to comment
iPrestege Posted May 9, 2013 Share Posted May 9, 2013 we should put in the weapon resource file or a new file? You can make a new file and test it. Link to comment
Sergei- Posted May 9, 2013 Author Share Posted May 9, 2013 is the sfx weapon file should contain multiple bullet shots or single shots? Link to comment
iPrestege Posted May 9, 2013 Share Posted May 9, 2013 is the sfx weapon file should contain multiple bullet shots or single shots? It's better to be a single shot. Link to comment
Sergei- Posted May 9, 2013 Author Share Posted May 9, 2013 ok i will try after downloading sfx.how to shake camera while shooting to show more realistic? Link to comment
Sergei- Posted May 9, 2013 Author Share Posted May 9, 2013 thanks i got the sfx.if you know to shake the camrea little while shooting tell me. Link to comment
iPrestege Posted May 9, 2013 Share Posted May 9, 2013 As far as i know you can use : onClientPlayerWeaponFire Add onClientRender Then getCameraMatrix After that : setCameraMatrix With + 0.5 Or something like that i hope you understand it and after that you have to spawn the player on the player position with getElementPosition And getElementModel Then setCmaeraTraget After All That spawnPlayer You must use TriggerServerEvent Or setElementPosition At the client sided . Link to comment
50p Posted May 9, 2013 Share Posted May 9, 2013 Instead of using setCameraMatrix I'd suggest to create fake explosion underneath the player. https://wiki.multitheftauto.com/wiki/CreateExplosion bool createExplosion ( float x, float y, float z, int theType [, bool makeSound = true, float camShake = -1.0, bool damaging = true ] ) When calling this function pass false as makeSound argument and damaging as false. This way player will not get damaged by the explosion and there won't be any sound but camera will shake. Link to comment
Sergei- Posted May 10, 2013 Author Share Posted May 10, 2013 5p where to put this line? addEventHandler("onClientPlayerWeaponFire", getRootElement(), function ( weapon, ammo, ammoInClip ) local x,y,z = getElementPosition(source) if weapon == 22 then local sound = playSound3D("hg.mp3", x,y,z) setSoundVolume(sound,10) setSoundMaxDistance(sound,75) end end ) Link to comment
PaiN^ Posted May 10, 2013 Share Posted May 10, 2013 addEventHandler ( 'onClientPlayerWeaponFire', root, function ( weapon, ammo, ammoInClip ) local x,y,z = getElementPosition ( source ) if weapon == 22 then local sound = playSound3D ( 'hg.mp3', x, y, z ) setSoundVolume ( sound, 10 ) setSoundMaxDistance ( sound, 75 ) createExplosion ( x, y, z - 0.2, 2, false, true, false ) end end ) Link to comment
Sergei- Posted May 10, 2013 Author Share Posted May 10, 2013 guys how to edit f1 items and f9 help panel? Link to comment
iPrestege Posted May 10, 2013 Share Posted May 10, 2013 guys how to edit f1 items and f9 help panel? 1- Fr_Client.lua File 2- Help.xml File Link to comment
PaiN^ Posted May 10, 2013 Share Posted May 10, 2013 Freeroam resource is scripted in a different way . If you aren't expert in scripting, I don't recommend modifying it . Link to comment
Sergei- Posted May 14, 2013 Author Share Posted May 14, 2013 the camshake is not working guys.give me example of the script. 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