Jump to content

Problem with backpack


Actimel

Recommended Posts

1 minute ago, NeXuS™ said:

Use setElementRotation on them. Can you copy the code again? And give me a list of those backpacks which are flipped.

addEventHandler("onElementDataChange", root, function(dataName, oldValue)
	if not oldValue then oldValue = 0; end
	if (getElementType(source) == "player") then
		if (dataName == "MAX_Slots") then
			local newValue = getElementData(source, dataName);
			removeBackpack(source);
			local x,y,z = getElementPosition(source);
			if (newValue == 12) then elementBackpack[source] = createObject(3026, x, y, z); -- Assault Pack (ACU)
			elseif (newValue == 16) then elementBackpack[source] = createObject(1248, x, y, z); -- Alice Pack
			elseif (newValue == 26) then elementBackpack[source] = createObject(1575, x, y, z); -- Czech Backpack
			elseif (newValue == 36) then elementBackpack[source] = createObject(1252, x, y, z); -- Coyote Backpack
			elseif (newValue == 44) then elementBackpack[source] = createObject(2734, x, y, z); -- Hunting Backpack
			elseif (newValue == 58) then elementBackpack[source] = createObject(371, x, y, z); -- violet Backpack WORKS GOOD
			elseif (newValue == 63) then elementBackpack[source] = createObject(373, x, y, z); -- orange Backpack WORKS GOOD
			elseif (newValue == 66) then elementBackpack[source] = createObject(2704, x, y, z); -- green Backpack WORKS GOOD
			elseif (newValue == 75) then elementBackpack[source] = createObject(2052, x, y, z); -- red mou Backpack Rotation problem
			elseif (newValue == 80) then elementBackpack[source] = createObject(2053, x, y, z); -- orange mou Backpack Rotation problem
			elseif (newValue >= 86) then elementBackpack[source] = createObject(2054, x, y, z); -- green mou Backpack Rotation problem
			elseif (newValue == 8) then return; end
			if elementBackpack[source] then
				setElementData(source, "tohide2", elementBackpack[source]);
				if (newValue >= 86) then
					setObjectScale(elementBackpack[source], 1.1);
				end
			end
			if (newValue == 26) then
				attachElementToBone(elementBackpack[source], source, 3, 0, -0.16, 0.05, 270, 0, 180);
			else
				attachElementToBone(elementBackpack[source], source, 3, 0, -0.225, 0.05, 90, 0, 0);
			end

@NeXuS™ this one ?

Edited by Actimel
Link to comment
if (newValue == 26 or newValue == 75 or newValue == 80 or newValue == 86) then
	attachElementToBone(elementBackpack[source], source, 3, 0, -0.16, 0.05, 270, 0, 180);
else
	attachElementToBone(elementBackpack[source], source, 3, 0, -0.225, 0.05, 90, 0, 0);
end

Replace line nr. 26 to nr 29. with this.

Link to comment
1 minute ago, NeXuS™ said:

if (newValue == 26 or newValue == 75 or newValue == 80 or newValue == 86) then
	attachElementToBone(elementBackpack[source], source, 3, 0, -0.16, 0.05, 270, 0, 180);
else
	attachElementToBone(elementBackpack[source], source, 3, 0, -0.225, 0.05, 90, 0, 0);
end

Replace line nr. 26 to nr 29. with this.

thanks man a lot it worked :)

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