Mido111 Posted August 22, 2016 Share Posted August 22, 2016 Hello , i need help in fully change weapons like shovel i want to change it to be same like deagle please help guys i really want to know (my first post) Link to comment
Furious^ONE! Posted August 22, 2016 Share Posted August 22, 2016 Hello, It's simple, take ID weapon (https://wiki.multitheftauto.com/wiki/Weapons) And create file "replace.lua" and copy code: function replaceModel() txd = engineLoadTXD("filename.txd", modelID ) -- Filename, if you file (deagle mod) name desert_eagle.txd. engineImportTXD(txd, modelID) dff = engineLoadDFF("filename.dff", ModelID ) -- Model ID, if you change skin deagle, use ID: 348 engineReplaceModel(dff, ModelID) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) And meta.xml <meta> <info name="Weapon Mod"></info> <script src="replace.lua" type="client"></script> <file src="filename.txd"></file> <file src="filename.dff"></file> </meta> Link to comment
Mido111 Posted August 22, 2016 Author Share Posted August 22, 2016 i dont mean the model i mean the way it shoots Link to comment
Decro Posted August 22, 2016 Share Posted August 22, 2016 i dont mean the model i mean the way it shoots Could you give a specific example? Link to comment
StefanAlmighty Posted August 22, 2016 Share Posted August 22, 2016 So you want to completely replace the shovel and use it as a physical gun which shoots? There are several things you can do to achieve this but it may be quite difficult for you: Start by replacing the shovels DFF and TXD with your choice of gun (for example the deagle). You can use bindKey to bind left-click and using getPedTarget you can get a target player. When the player shoots you can deduct health from the target using setElementHealth and getElementHealth. Then to make the sound effects you can use playSound and setSoundVolume for all nearby players. For the blood effect (when they're shot) you can use fxAddBlood which will simulate when the player is shot with a real GTA gun. For the crosshair you can use getKeyState (to check if they're aiming) and then render some dx shapes. Link to comment
Mido111 Posted August 23, 2016 Author Share Posted August 23, 2016 So you want to completely replace the shovel and use it as a physical gun which shoots? There are several things you can do to achieve this but it may be quite difficult for you: Start by replacing the shovels DFF and TXD with your choice of gun (for example the deagle). You can use bindKey to bind left-click and using getPedTarget you can get a target player. When the player shoots you can deduct health from the target using setElementHealth and getElementHealth. Then to make the sound effects you can use playSound and setSoundVolume for all nearby players. For the blood effect (when they're shot) you can use fxAddBlood which will simulate when the player is shot with a real GTA gun. For the crosshair you can use getKeyState (to check if they're aiming) and then render some dx shapes. any more ?? , or another way with setWeaponProperty Link to comment
StefanAlmighty Posted August 23, 2016 Share Posted August 23, 2016 any more ?? , or another way with setWeaponProperty Take a look here: https://wiki.multitheftauto.com/wiki/SetWeaponProperty According to this you cannot modify the shovel using this function so the method I posted above would be most appropriate in your case. Good luck. Link to comment
Mido111 Posted September 8, 2016 Author Share Posted September 8, 2016 ok how to show ammo 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