Andrew75t Posted August 13, 2020 Share Posted August 13, 2020 Hello all. question about replacing models. I want to replace the standard sniper rifle model, there will be three models to choose from. If i choose one model, and if another player chooses the second one. Will I see only the model that I have chosen or will I see both mine and his? is it possible to implement it on the server? Link to comment
Administrators Tut Posted August 13, 2020 Administrators Share Posted August 13, 2020 I haven't tried it myself, but should be possible by having all 3 models inside a dff as one mesh. You would assign an opacity shader that clears the textures from view depending on which rifle should be visible. Another way is replacing 3 unused world objects, and then attaching those to the rifle and setting the held rifle invisible. I have moved your question to the Scripting section Link to comment
Andrew75t Posted August 15, 2020 Author Share Posted August 15, 2020 Hey. Do I must attach objects to weapon or to the player's hands? When I try to attach an object to a player, I get the ERROR. I made the standard rifle model invisible. But I don't know how to attach object to this sniper rifle exports error: Call to non-running server resource (bone_attach) [string "?"] im use this code function attachCash (thePlayer) local x, y, z = getElementPosition (thePlayer) setPedAnimation (thePlayer, "ROB_BANK", "CAT_Safe_Rob", -1, true, false, false) local objPick = createObject (1550, x, y, z) setTimer (function (thePlayer) setPedAnimation (thePlayer, nil) exports.bone_attach:attachElementToBone (objPick, thePlayer, 4, -0.3, 0.2, 0, -125, 0, 0) end, 1000, 1, thePlayer) end addCommandHandler ("getbag", attachCash) Link to comment
Investor Posted August 15, 2020 Share Posted August 15, 2020 You're going to need to have the resource bone_attach installed and running on your server. Link to comment
Andrew75t Posted August 16, 2020 Author Share Posted August 16, 2020 Investor, please, tell me how i can to do it right? Link to comment
Andrew75t Posted August 16, 2020 Author Share Posted August 16, 2020 I managed to set bone_attach. I was able to set the model in the hands of the character as I needed. But in aiming mode, I see the attached weapon model. How can you remove it in aiming mode? Link to comment
Zorgman Posted August 17, 2020 Share Posted August 17, 2020 You have to setElementAlpha onClientKey. Link to comment
Andrew75t Posted August 18, 2020 Author Share Posted August 18, 2020 it is perfectly. Thanks a lot to everyone who answered. You helped me a lot. 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