Jump to content

help adding weapon in DayZ


adi8908456

Recommended Posts

Hi! i have another problem. I added new weapon to dayz (m16a2) everything works but when i want to equip weapon it show a new weapon (m16) and old m4. Like 2 weapons in one, when i want to shoot for one shoot take two ammo.

Have warning in debugscript

survivorsystem.lua545: Bad argument @ 'destroyElement' [expected element at argument 1,got boolean]

LINE 36 is 545 in script

Script:

function weaponSwitchBack ( previousWeaponID, currentWeaponID ) 
 local weapon1 = getElementData(source,"currentweapon_1") 
 if not weapon1 then return end 
 local ammoData1,weapID1 = getWeaponAmmoType(weapon1) 
 local x,y,z = getElementPosition(source) 
 local rx,ry,rz = getElementRotation(source) 
          if previousWeaponID == weapID1 then 
           if elementWeaponBack[source] then 
            detachElementFromBone(elementWeaponBack[source]) 
            destroyElement(elementWeaponBack[source]) 
            elementWeaponBack[source] = false 
           end 
           if weapon1 == "M16A2" then 
           elementWeaponBack[source] = createObject(2726,x,y,z) 
           setObjectScale(elementWeaponBack[source],0.875) 
           elseif weapon1 == "NOME DA SUA ARMA" then 
           elementWeaponBack[source] = createObject(2725,x,y,z) 
           setObjectScale(elementWeaponBack[source],0.875) 
           elseif weapon1 == "NOME DA SUA ARMA" then 
           elementWeaponBack[source] = createObject(2644,x,y,z) 
           setObjectScale(elementWeaponBack[source],0.875) 
           elseif weapon1 == "NOME DA SUA ARMA" then 
           elementWeaponBack[source] = createObject(2708,x,y,z) 
           setObjectScale(elementWeaponBack[source],0.875) 
           else 
           elementWeaponBack[source] = createObject(getWeaponObjectID(weapID1),x,y,z) 
           setObjectScale(elementWeaponBack[source],0.875) 
           end 
           if elementBackpack[source] then 
            attachElementToBone(elementWeaponBack[source],source,3,0.19,-0.31,-0.1,0,270,-90) 
           else 
            attachElementToBone(elementWeaponBack[source],source,3,0.19,-0.11,-0.1,0,270,10) 
           end 
          elseif currentWeaponID == weapID1 then 
           detachElementFromBone(elementWeaponBack[source]) 
           destroyElement(elementWeaponBack[source]) 
           elementWeaponBack[source] = false 
          end 

screenshoot : http://i.imgur.com/niYGhBY.png

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