Jump to content

Scripts to repair


Recommended Posts

Thanks you for reply.

Im use gamemode DayZ 0.6 r294 + default bot (slothbot?). This bots is include in DayZ 0.6 r294 server files.

Im find error in this script:

WARNING: guns\command_kill.lua:38: Bad argument @ 'bindKey' [Expected player at argument 1, got string 'mouse1'] 

command_kill.lua

function attach ( ) 
          local theVehicle = getPedOccupiedVehicle ( localPlayer ) 
          if theVehicle then 
          local x,y,z = getElementPosition ( theVehicle ) 
          weapon = createWeapon("minigun",x-3, y , z+1) 
          setElementRotation(weapon,0,0,7) 
          attachElements ( weapon, theVehicle, -0.2, -1.5, -0.2) 
          setWeaponClipAmmo(weapon, 99999) 
          setWeaponState(weapon, "ready") 
          setWeaponProperty(weapon, "fire_rotation", 0, -30, 0) 
          setElementPosition(localPlayer,x-1.5, y , z+1) 
    end 
    end 
    addCommandHandler ( "attach", attach ) 
    local aimSensitivity = 30; 
      
    function rotateGun_Handler(cX, cY, aX, aY, wX, wY, wZ) 
        local oX, oY, oZ, oRX, oRY, oRZ = getElementAttachedOffsets(weapon); 
        if (oRX-((cY-0.5)*aimSensitivity) > 345 or oRX-((cY-0.5)*aimSensitivity) < 30) then -- Pitch Restriction 
                oRX = oRX-((cY-0.5)*aimSensitivity); 
        end 
        if (oRZ-((cX-0.5)*aimSensitivity) > 330 or oRZ-((cX-0.5)*aimSensitivity) < 360) then -- Yaw Restriction 
                oRZ = oRZ-((cX-0.5)*aimSensitivity); 
        end 
        setCameraTarget(weapon,weapon) 
        setElementAttachedOffsets(weapon, oX, oY, oZ, oRX, oRY, oRZ); 
        setCursorPosition(screenW/2, screenH/2); 
    end 
    addEventHandler( "onClientCursorMove", getRootElement( ), rotateGun_Handler) 
      
    function fireme() 
    setTimer(function() 
    if getWeaponState(weapon) == "ready" then 
    setWeaponState(weapon, "firing") 
    else return end 
    end,1000,0) 
    end 
    bindKey("mouse1", "down", fireme) 

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