Jump to content

Player Held Weapon


Recommended Posts

There's no function to do that, but it's still not impossible

to be honest i dont really know exactly how because haven't tried to think about that before

and idont think anyone gonna tell you how if he know

so start to think how to make in your way

(sorry if this is useless reply)

Link to comment

create a attachElementToBone when equip the m4, leaves the invisible m4 not bugar with the skin you created a attachElementToBone also use onPlayerWeaponSwitch for hand gun use detachElementFromBone disappear for it whatever

sorry my english

elementWeaponReplace = {} 
function weaponReplace ( ) 
       weapon = getPedWeapon( getLocalPlayer()) 
      local x,y,z = getElementPosition(source) 
    if weapon == 31 then 
        elementWeaponReplace[source] = createObject(1943,x,y,z) 
        setObjectScale(elementWeaponReplace[source],0.875) 
    end 
    exports.bone_attach:attachElementToBone(elementWeaponReplace[source],source,12,0,0,0,180,90,180) 
addEventHandler ( "onPlayerWeaponSwitch", getRootElement(), weaponReplace ) 

i don't know :/

Download Bone_Attach: https://forum.multitheftauto.com/viewtopic.php?f=91&t=44088

Edited by Guest
Link to comment
create a attachElementToBone when equip the m4, leaves the invisible m4 not bugar with the skin you created a attachElementToBone also use onPlayerWeaponSwitch for hand gun use detachElementFromBone disappear for it whatever

sorry my english

elementWeaponReplace = {} 
function weaponReplace ( ) 
       weapon = getPedWeapon( getLocalPlayer()) 
    if weapon == 31 then 
        elementWeaponReplace[source] = createObject(1943,x,y,z) 
        setObjectScale(elementWeaponReplace[source],0.875) 
    end 
    attachElementToBone(elementWeaponReplace[source],source,12,0,0,0,180,90,180) 
addEventHandler ( "onPlayerWeaponSwitch", getRootElement(), weaponReplace ) 

i don't know :/

Download Bone_Attach: https://forum.multitheftauto.com/viewtopic.php?f=91&t=44088

??? x, y, z it's not defined in your code.

Wrong

Edited by Guest
Link to comment
create a attachElementToBone when equip the m4, leaves the invisible m4 not bugar with the skin you created a attachElementToBone also use onPlayerWeaponSwitch for hand gun use detachElementFromBone disappear for it whatever

sorry my english

elementWeaponReplace = {} 
function weaponReplace ( ) 
       weapon = getPedWeapon( getLocalPlayer()) 
    if weapon == 31 then 
        elementWeaponReplace[source] = createObject(1943,x,y,z) 
        setObjectScale(elementWeaponReplace[source],0.875) 
    end 
    attachElementToBone(elementWeaponReplace[source],source,12,0,0,0,180,90,180) 
addEventHandler ( "onPlayerWeaponSwitch", getRootElement(), weaponReplace ) 

i don't know :/

Download Bone_Attach: https://forum.multitheftauto.com/viewtopic.php?f=91&t=44088

my idea was some what similar to this, but your code doesn't make any sense, If you are using that resource then you will have to use exports. also onplayerweaponswitch is server side it will effect every one.

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...