Jump to content

Search the Community

Showing results for tags 'setelementalpha'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 1 result

  1. I have a script-chec k, if the player has a sniper rifle in his hands and he is aiming, then a message is displayed in the chat. In the sight I see the model of the object (id 321) that I replaced and attached using bone_attach. I want it to become transparent in aiming mode. How do I apply setElementAlpha to this object? I made a transparent texture for the default rifle (id 34). And with the help of bone_attach, I attached the object (id 321), which I replaced with the new SVD model. When I am in aiming mode I see the SVD model, I need to make it transparent (invisible) Client side: function aimAction (key, state) if (getPedWeapon (localPlayer) ~= 34) then return end outputChatBox ("You are aiming now", 255, 0, 0) for control in pairs (getBoundControls(key)) do setPedControlState (control, false) end end bindKey ("mouse2", "down", aimAction) Server side: function attachSVD (thePlayer) local x, y, z = getElementPosition (thePlayer) local objPick = createObject (321, x, y, z) setTimer (function (thePlayer) giveWeapon ( thePlayer, 34, 200, true ) exports.bone_attach:attachElementToBone (objPick, thePlayer, 12, 0, 0, 0, 0, -90, 0) end, 1000, 1, thePlayer) end addCommandHandler ("svd", attachSVD) Repale models: function replaceWeapon() -- Invisible defolt sniper riflle txd = engineLoadTXD ( "mdls/weapons/sniper_rifle/sniper.txd" ) engineImportTXD ( txd, 358) -- SVD model -- txd = engineLoadTXD ( "mdls/weapons/sniper_rifle/svd.txd" ) engineImportTXD ( txd, 321) dff = engineLoadDFF ( "mdls/weapons/sniper_rifle/svd.dff") engineReplaceModel ( dff, 321) end addEventHandler ( "onClientResourceStart", resourceRoot, replaceWeapon)
×
×
  • Create New...