Jump to content

Replace models


Andrew75t

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...