variablePuntePalletB = {};
function variablePuntePalletB.prerequisitesPresent(specializations) return true; end;
function variablePuntePalletB:load(xmlFile)
    local fermiSound = getXMLString(xmlFile, "vehicle.fermiSound#file"); fermiSound  = Utils.getFilename(fermiSound, self.baseDirectory);
    self.fermiSound = createSample("fermiSound"); loadSample(self.fermiSound, fermiSound, false);
	self.setcurrentPuntePalletB = SpecializationUtil.callSpecializationsFunction("setcurrentPuntePalletB");
	self.setcurrentPosDirB = SpecializationUtil.callSpecializationsFunction("setcurrentPosDirB");
	self.setcurrentPuntaDxB = SpecializationUtil.callSpecializationsFunction("setcurrentPuntaDxB"); 
	self.setcurrentPuntaSxB = SpecializationUtil.callSpecializationsFunction("setcurrentPuntaSxB"); self.currentPuntePalletB = -1; end;
function variablePuntePalletB:delete() end;
function variablePuntePalletB:readStream(streamId, connection) self:setcurrentPuntePalletB(streamReadInt8(streamId), true); self:setcurrentPosDirB(streamReadInt8(streamId), true); self:setcurrentPuntaDxB(streamReadInt8(streamId), true); self:setcurrentPuntaSxB(streamReadInt8(streamId), true); end;
function variablePuntePalletB:writeStream(streamId, connection) streamWriteInt8(streamId, self.currentPuntePalletB); streamWriteInt8(streamId, self.currentPosDirB); streamWriteInt8(streamId, self.currentPuntaDxB); streamWriteInt8(streamId, self.currentPuntaSxB); end;
function variablePuntePalletB:setcurrentPuntePalletB(int, noEventSend) self.currentPuntePalletB = int; setcurrentPuntePalletBEvent.sendEvent(self, int, noEventSend); end;
function variablePuntePallet:setcurrentPosDirB(int, noEventSend) self.currentPosDirB = int; setcurrentPosDirBEvent.sendEvent(self, int, noEventSend); end;
function variablePuntePalletB:setcurrentPuntaDxB(int, noEventSend) self.currentPuntaDxB = int; setcurrentPuntaDxBEvent.sendEvent(self, int, noEventSend); end;
function variablePuntePalletB:setcurrentPuntaSxB(int, noEventSend) self.currentPuntaSxB = int; setcurrentPuntaSxBEvent.sendEvent(self, int, noEventSend); end;
function variablePuntePalletB:loadFromAttributesAndNodes(xmlFile, key, resetVehicles)
	local currentPuntaDxB = getXMLInt(xmlFile, key .. "#currentPuntaDxB"); if currentPuntaDxB ~= nil then self:setcurrentPuntaDxB(currentPuntaDxB-1); setTranslation(self.fermiDxB, (currentPuntaDxB)/2*self.dist-self.distCB, 0.756, 0.084); end;
	local currentPuntaSxB = getXMLInt(xmlFile, key .. "#currentPuntaSxB"); if currentPuntaSxB ~= nil then self:setcurrentPuntaSxB(currentPuntaSxB-1); setTranslation(self.fermiSxB, (currentPuntaSxB)/2*self.dist-self.distCB, 0.756, 0.084); end;
	if currentPuntaDxB/2 == 1 or currentPuntaSxB/2 == 1 then self.pos01 = false; end; if currentPuntaDxB/2 == 2 or currentPuntaSxB/2 == 2 then self.pos02 = false; end;
	if currentPuntaDxB/2 == 3 or currentPuntaSxB/2 == 3 then self.pos03 = false; end; if currentPuntaDxB/2 == 4 or currentPuntaSxB/2 == 4 then self.pos04 = false; end;
	if currentPuntaDxB/2 == 5 or currentPuntaSxB/2 == 5 then self.pos05 = false; end; if currentPuntaDxB/2 == 6 or currentPuntaSxB/2 == 6 then self.pos06 = false; end;
	if currentPuntaDxB/2 == 7 or currentPuntaSxB/2 == 7 then self.pos07 = false; end; if currentPuntaDxB/2 == 8 or currentPuntaSxB/2 == 8 then self.pos08 = false; end;
	if currentPuntaDxB/2 == 9 or currentPuntaSxB/2 == 9 then self.pos09 = false; end; if currentPuntaDxB/2 == 10 or currentPuntaSxB/2 == 10 then self.pos10 = false; end;
	if currentPuntaDxB/2 == 11 or currentPuntaSxB/2 == 11 then self.pos11 = false; end; if currentPuntaDxB/2 == 12 or currentPuntaSxB/2 == 12 then self.pos12 = false; end;
	if currentPuntaDxB/2 == 13 or currentPuntaSxB/2 == 13 then self.pos13 = false; end; if currentPuntaDxB/2 == 14 or currentPuntaSxB/2 == 14 then self.pos14 = false; end;
	if currentPuntaDxB/2 == 15 or currentPuntaSxB/2 == 15 then self.pos15 = false; end;	if currentPuntaDxB/2 == 16 or currentPuntaSxB/2 == 16 then self.pos16 = false; end;
	if currentPuntaDxB/2 == 17 or currentPuntaSxB/2 == 17 then self.pos17 = false; end;	if currentPuntaDxB/2 == 18 or currentPuntaSxB/2 == 18 then self.pos18 = false; end;
	if currentPuntaDxB/2 == 19 or currentPuntaSxB/2 == 19 then self.pos19 = false; end;	if currentPuntaDxB/2 == 20 or currentPuntaSxB/2 == 20 then self.pos20 = false; end;
	if currentPuntaDxB/2 == 21 or currentPuntaSxB/2 == 21 then self.pos21 = false; end;	if currentPuntaDxB/2 == 22 or currentPuntaSxB/2 == 22 then self.pos22 = false; end;
	if currentPuntaDxB/2 == 23 or currentPuntaSxB/2 == 23 then self.pos23 = false; end;	if currentPuntaDxB/2 == 24 or currentPuntaSxB/2 == 24 then self.pos24 = false; end;
	return BaseMission.VEHICLE_LOAD_OK; end;
function variablePuntePalletB:getSaveAttributesAndNodes(nodeIdent) local attributes = 'currentPuntaDxB="' .. self.currentPuntaDxB .. '" currentPuntaSxB="' .. self.currentPuntaSxB .. '"'; return attributes; end;
function variablePuntePalletB:mouseEvent(posX, posY, isDown, isUp, button) end;
function variablePuntePalletB:keyEvent(unicode, sym, modifier, isDown) end;
function variablePuntePalletB:update(dt)
	if g_currentMission.player ~= nil and g_currentMission.player.isEntered then
		local px, py, pz = getWorldTranslation(g_currentMission.player.rootNode); local tx, ty, tz = getWorldTranslation(self.components[1].node);
		if self.attacherVehicle ~= nil and Utils.vector3Length(px-tx, py-ty, pz-tz) < 4 then
			if InputBinding.hasEvent(InputBinding.CAMERA_SWITCH) then 
				if     self.currentPuntePalletB == 1 and not self:getIsAnimationPlaying("fermiB") then self:setcurrentPuntePalletB(5);
				elseif self.currentPuntePalletB == 5 and not self:getIsAnimationPlaying("fermiB") then self:setcurrentPuntePalletB(1); end; end;
			if InputBinding.hasEvent(InputBinding.attachCSZ) then
				if     self.currentPuntePalletB == 1 and not self:getIsAnimationPlaying("fermiB") then self:setcurrentPuntePalletB(2);
				elseif self.currentPuntePalletB == 3 and not self:getIsAnimationPlaying("fermiB") then self:setcurrentPuntePalletB(0);				
				elseif self.currentPuntePalletB == 5 and not self:getIsAnimationPlaying("fermiB") then self:setcurrentPuntePalletB(6);				
				elseif self.currentPuntePalletB == 7 and not self:getIsAnimationPlaying("fermiB") then self:setcurrentPuntePalletB(4); end; end;
			if     self.currentPuntePalletB == 3 or self.currentPuntePalletB == 7 and not self:getIsAnimationPlaying("fermiB") then g_currentMission:addHelpButtonText(g_i18n:getText("fermiClose"), InputBinding.attachCSZ);
			elseif self.currentPuntePalletB == 1 or self.currentPuntePalletB == 5 and not self:getIsAnimationPlaying("fermiB") then g_currentMission:addHelpButtonText(g_i18n:getText("fermiOpen"), InputBinding.attachCSZ); g_currentMission:addHelpButtonText(g_i18n:getText("cambiaOggetto"), InputBinding.CAMERA_SWITCH); end;
			if self.currentPuntePalletB == 1 or self.currentPuntePalletB == 3 then g_currentMission:addExtraPrintText(g_i18n:getText("punteDestra")..g_i18n:getText("puntaDestraBA")..g_i18n:getText("puntaSinistraBI")); elseif self.currentPuntePalletB == 5 or self.currentPuntePalletB == 7 then g_currentMission:addExtraPrintText(g_i18n:getText("punteDestra")..g_i18n:getText("puntaDestraBI")..g_i18n:getText("puntaSinistraBA")); end;
			if (self.currentPuntePallet == 1 or self.currentPuntePallet == 5 or self.currentPuntePallet == -1) and (self.currentPuntePalletB == 1 or self.currentPuntePalletB == 5 or self.currentPuntePalletB == -1) then
				if InputBinding.hasEvent(InputBinding.selectRightKP) and self.currentPuntePalletB == -1 then self.currentPuntePalletB = 1; self.currentPuntePallet = -1; end; if InputBinding.hasEvent(InputBinding.selectLeftKP) and self.currentPuntePallet == -1 then self.currentPuntePalletB = -1; self.currentPuntePallet = 1; end; 
				if self.currentPuntePalletB == -1 then g_currentMission:addHelpButtonText(g_i18n:getText("punteDestra"), InputBinding.selectRightKP); end; 
				if self.currentPuntePallet == -1 then g_currentMission:addHelpButtonText(g_i18n:getText("punteSinistra"), InputBinding.selectLeftKP); end; end;
			if self.currentPosDirB == 0 and (self.currentPuntePalletB == 3 or self.currentPuntePalletB == 7) then
				if InputBinding.hasEvent(InputBinding.selectLeftKP)  then self:setcurrentPosDirB(-1); end; if InputBinding.hasEvent(InputBinding.selectRightKP) then self:setcurrentPosDirB(1); end; 
				if self.currentPuntePalletB == 3 then if self.currentPuntaDxB < self.currentPuntaSxB - 2 then g_currentMission:addHelpButtonText(g_i18n:getText("puntaSpostaDestra"), InputBinding.selectRightKP); end; if self.currentPuntaDxB / 2 > self.currentPuntaSx then g_currentMission:addHelpButtonText(g_i18n:getText("puntaSpostaSinistra"), InputBinding.selectLeftKP); end; end; 
				if self.currentPuntePalletB == 7 then if self.currentPuntaSxB / 2 < self.positions then g_currentMission:addHelpButtonText(g_i18n:getText("puntaSpostaDestra"), InputBinding.selectRightKP); end; if self.currentPuntaSxB > self.currentPuntaDxB + 2 then g_currentMission:addHelpButtonText(g_i18n:getText("puntaSpostaSinistra"), InputBinding.selectLeftKP); end; end; end; end; end; end;
function variablePuntePalletB:updateTick(dt)
	if     self.currentPuntePalletB == 0 then self:playAnimation("fermoSinistraB", -4, nil, true); setTranslation(self.fermiDxB, self.currentPuntaDxB/2*self.dist-self.distCB, 0.756, 0.084); self.currentPuntePalletB = 1; playSample(self.fermiSound, 1, 1, 0);
	elseif self.currentPuntePalletB == 2 then self:playAnimation("fermoSinistraB", 1, nil, true); self.currentPuntePalletB = 3; 
	elseif self.currentPuntePalletB == 4 then self:playAnimation("fermoDestraB", -4, nil, true); setTranslation(self.fermiSxB, self.currentPuntaSxB/2*self.dist-self.distCB, 0.756, 0.084); self.currentPuntePalletB = 5; playSample(self.fermiSound, 1, 1, 0);
	elseif self.currentPuntePalletB == 6 then self:playAnimation("fermoDestraB", 1, nil, true); self.currentPuntePalletB = 7; end;
	if self.currentPuntePalletB == 3 then
		if self.currentPuntaDxB ==  2 then if self.currentPosDirB == 1 and self.pos02 == true then self:setcurrentPuntaDxB(3); self.pos01 = true; self.pos02 = false; end; end;
		if self.currentPuntaDxB ==  4 then if self.currentPosDirB == 1 and self.pos03 == true then self:setcurrentPuntaDxB(5); self.pos02 = true; self.pos03 = false; end; if self.currentPosDirB == -1 and self.pos01 == true then self:setcurrentPuntaDxB(1); self.pos02 = true; self.pos01 = false; end; end;
		if self.currentPuntaDxB ==  6 then if self.currentPosDirB == 1 and self.pos04 == true then self:setcurrentPuntaDxB(7); self.pos03 = true; self.pos04 = false; end; if self.currentPosDirB == -1 and self.pos02 == true then self:setcurrentPuntaDxB(3); self.pos03 = true; self.pos02 = false; end; end;
		if self.currentPuntaDxB ==  8 then if self.currentPosDirB == 1 and self.pos05 == true then self:setcurrentPuntaDxB(9); self.pos04 = true; self.pos05 = false; end; if self.currentPosDirB == -1 and self.pos03 == true then self:setcurrentPuntaDxB(5); self.pos04 = true; self.pos03 = false; end; end;
		if self.currentPuntaDxB == 10 then if self.currentPosDirB == 1 and self.pos06 == true then self:setcurrentPuntaDxB(11); self.pos05 = true; self.pos06 = false; end; if self.currentPosDirB == -1 and self.pos04 == true then self:setcurrentPuntaDxB(7); self.pos05 = true; self.pos04 = false; end; end;
		if self.currentPuntaDxB == 12 then if self.currentPosDirB == 1 and self.pos07 == true then self:setcurrentPuntaDxB(13); self.pos06 = true; self.pos07 = false; end; if self.currentPosDirB == -1 and self.pos05 == true then self:setcurrentPuntaDxB(9); self.pos06 = true; self.pos05 = false; end; end;
		if self.currentPuntaDxB == 14 then if self.currentPosDirB == 1 and self.pos08 == true then self:setcurrentPuntaDxB(15); self.pos07 = true; self.pos08 = false; end; if self.currentPosDirB == -1 and self.pos06 == true then self:setcurrentPuntaDxB(11); self.pos07 = true; self.pos06 = false; end; end;
		if self.currentPuntaDxB == 16 then if self.currentPosDirB == 1 and self.pos09 == true then self:setcurrentPuntaDxB(17); self.pos08 = true; self.pos09 = false; end; if self.currentPosDirB == -1 and self.pos07 == true then self:setcurrentPuntaDxB(13); self.pos08 = true; self.pos07 = false; end; end;
		if self.currentPuntaDxB == 18 then if self.currentPosDirB == 1 and self.pos10 == true then self:setcurrentPuntaDxB(19); self.pos09 = true; self.pos10 = false; end; if self.currentPosDirB == -1 and self.pos08 == true then self:setcurrentPuntaDxB(15); self.pos09 = true; self.pos08 = false; end; end;
		if self.currentPuntaDxB == 20 then if self.currentPosDirB == 1 and self.pos11 == true then self:setcurrentPuntaDxB(21); self.pos10 = true; self.pos11 = false; end; if self.currentPosDirB == -1 and self.pos09 == true then self:setcurrentPuntaDxB(17); self.pos10 = true; self.pos09 = false; end; end;
		if self.currentPuntaDxB == 22 then if self.currentPosDirB == 1 and self.pos12 == true then self:setcurrentPuntaDxB(23); self.pos11 = true; self.pos12 = false; end; if self.currentPosDirB == -1 and self.pos10 == true then self:setcurrentPuntaDxB(19); self.pos11 = true; self.pos10 = false; end; end;
		if self.currentPuntaDxB == 24 then                                                                                                                                  if self.currentPosDirB == -1 and self.pos11 == true then self:setcurrentPuntaDxB(21); self.pos12 = true; self.pos11 = false; end; end;
	if self.positions > 12 then 
		if self.currentPuntaDxB == 24 then if self.currentPosDirB == 1 and self.pos13 == true then self:setcurrentPuntaDxB(25); self.pos12 = true; self.pos13 = false; end; end;
		if self.currentPuntaDxB == 26 then if self.currentPosDirB == 1 and self.pos14 == true then self:setcurrentPuntaDxB(27); self.pos13 = true; self.pos14 = false; end; if self.currentPosDirB == -1 and self.pos12 == true then self:setcurrentPuntaDxB(23); self.pos13 = true; self.pos12 = false; end; end;
		if self.currentPuntaDxB == 28 then if self.currentPosDirB == 1 and self.pos15 == true then self:setcurrentPuntaDxB(29); self.pos14 = true; self.pos15 = false; end; if self.currentPosDirB == -1 and self.pos13 == true then self:setcurrentPuntaDxB(25); self.pos14 = true; self.pos13 = false; end; end;
		if self.currentPuntaDxB == 30 then if self.currentPosDirB == 1 and self.pos16 == true then self:setcurrentPuntaDxB(31); self.pos15 = true; self.pos16 = false; end; if self.currentPosDirB == -1 and self.pos14 == true then self:setcurrentPuntaDxB(27); self.pos15 = true; self.pos14 = false; end; end;
		if self.currentPuntaDxB == 32 then if self.currentPosDirB == 1 and self.pos17 == true then self:setcurrentPuntaDxB(33); self.pos16 = true; self.pos17 = false; end; if self.currentPosDirB == -1 and self.pos15 == true then self:setcurrentPuntaDxB(29); self.pos16 = true; self.pos15 = false; end; end;
		if self.currentPuntaDxB == 34 then if self.currentPosDirB == 1 and self.pos18 == true then self:setcurrentPuntaDxB(35); self.pos17 = true; self.pos18 = false; end; if self.currentPosDirB == -1 and self.pos16 == true then self:setcurrentPuntaDxB(31); self.pos17 = true; self.pos16 = false; end; end;
		if self.currentPuntaDxB == 36 then if self.currentPosDirB == 1 and self.pos19 == true then self:setcurrentPuntaDxB(37); self.pos18 = true; self.pos19 = false; end; if self.currentPosDirB == -1 and self.pos17 == true then self:setcurrentPuntaDxB(33); self.pos18 = true; self.pos17 = false; end; end;
		if self.currentPuntaDxB == 38 then if self.currentPosDirB == 1 and self.pos20 == true then self:setcurrentPuntaDxB(39); self.pos19 = true; self.pos20 = false; end; if self.currentPosDirB == -1 and self.pos18 == true then self:setcurrentPuntaDxB(35); self.pos19 = true; self.pos18 = false; end; end;
		if self.currentPuntaDxB == 40 then if self.currentPosDirB == 1 and self.pos21 == true then self:setcurrentPuntaDxB(41); self.pos20 = true; self.pos21 = false; end; if self.currentPosDirB == -1 and self.pos19 == true then self:setcurrentPuntaDxB(37); self.pos20 = true; self.pos19 = false; end; end;
		if self.currentPuntaDxB == 42 then if self.currentPosDirB == 1 and self.pos22 == true then self:setcurrentPuntaDxB(43); self.pos21 = true; self.pos22 = false; end; if self.currentPosDirB == -1 and self.pos20 == true then self:setcurrentPuntaDxB(39); self.pos21 = true; self.pos20 = false; end; end;
		if self.currentPuntaDxB == 44 then if self.currentPosDirB == 1 and self.pos23 == true then self:setcurrentPuntaDxB(45); self.pos22 = true; self.pos23 = false; end; if self.currentPosDirB == -1 and self.pos21 == true then self:setcurrentPuntaDxB(41); self.pos22 = true; self.pos21 = false; end; end;
		if self.currentPuntaDxB == 46 then if self.currentPosDirB == 1 and self.pos24 == true then self:setcurrentPuntaDxB(47); self.pos23 = true; self.pos24 = false; end; if self.currentPosDirB == -1 and self.pos22 == true then self:setcurrentPuntaDxB(43); self.pos23 = true; self.pos22 = false; end; end;
		if self.currentPuntaDxB == 48 then                                                                                                                                  if self.currentPosDirB == -1 and self.pos23 == true then self:setcurrentPuntaDxB(45); self.pos24 = true; self.pos23 = false; end; end;
	end; self.currentPosDirB = 0; end;
	if self.currentPuntePalletB == 7 then
		if self.currentPuntaSxB ==  2 then if self.currentPosDirB == 1 and self.pos02 == true then self:setcurrentPuntaSxB(3); self.pos01 = true; self.pos02 = false; end; end;
		if self.currentPuntaSxB ==  4 then if self.currentPosDirB == 1 and self.pos03 == true then self:setcurrentPuntaSxB(5); self.pos02 = true; self.pos03 = false; end; if self.currentPosDirB == -1 and self.pos01 == true then self:setcurrentPuntaSxB(1); self.pos02 = true; self.pos01 = false; end; end;
		if self.currentPuntaSxB ==  6 then if self.currentPosDirB == 1 and self.pos04 == true then self:setcurrentPuntaSxB(7); self.pos03 = true; self.pos04 = false; end; if self.currentPosDirB == -1 and self.pos02 == true then self:setcurrentPuntaSxB(3); self.pos03 = true; self.pos02 = false; end; end;
		if self.currentPuntaSxB ==  8 then if self.currentPosDirB == 1 and self.pos05 == true then self:setcurrentPuntaSxB(9); self.pos04 = true; self.pos05 = false; end; if self.currentPosDirB == -1 and self.pos03 == true then self:setcurrentPuntaSxB(5); self.pos04 = true; self.pos03 = false; end; end;
		if self.currentPuntaSxB == 10 then if self.currentPosDirB == 1 and self.pos06 == true then self:setcurrentPuntaSxB(11); self.pos05 = true; self.pos06 = false; end; if self.currentPosDirB == -1 and self.pos04 == true then self:setcurrentPuntaSxB(7); self.pos05 = true; self.pos04 = false; end; end;
		if self.currentPuntaSxB == 12 then if self.currentPosDirB == 1 and self.pos07 == true then self:setcurrentPuntaSxB(13); self.pos06 = true; self.pos07 = false; end; if self.currentPosDirB == -1 and self.pos05 == true then self:setcurrentPuntaSxB(9); self.pos06 = true; self.pos05 = false; end; end;
		if self.currentPuntaSxB == 14 then if self.currentPosDirB == 1 and self.pos08 == true then self:setcurrentPuntaSxB(15); self.pos07 = true; self.pos08 = false; end; if self.currentPosDirB == -1 and self.pos06 == true then self:setcurrentPuntaSxB(11); self.pos07 = true; self.pos06 = false; end; end;
		if self.currentPuntaSxB == 16 then if self.currentPosDirB == 1 and self.pos09 == true then self:setcurrentPuntaSxB(17); self.pos08 = true; self.pos09 = false; end; if self.currentPosDirB == -1 and self.pos07 == true then self:setcurrentPuntaSxB(13); self.pos08 = true; self.pos07 = false; end; end;
		if self.currentPuntaSxB == 18 then if self.currentPosDirB == 1 and self.pos10 == true then self:setcurrentPuntaSxB(19); self.pos09 = true; self.pos10 = false; end; if self.currentPosDirB == -1 and self.pos08 == true then self:setcurrentPuntaSxB(15); self.pos09 = true; self.pos08 = false; end; end;
		if self.currentPuntaSxB == 20 then if self.currentPosDirB == 1 and self.pos11 == true then self:setcurrentPuntaSxB(21); self.pos10 = true; self.pos11 = false; end; if self.currentPosDirB == -1 and self.pos09 == true then self:setcurrentPuntaSxB(17); self.pos10 = true; self.pos09 = false; end; end;
		if self.currentPuntaSxB == 22 then if self.currentPosDirB == 1 and self.pos12 == true then self:setcurrentPuntaSxB(23); self.pos11 = true; self.pos12 = false; end; if self.currentPosDirB == -1 and self.pos10 == true then self:setcurrentPuntaSxB(19); self.pos11 = true; self.pos10 = false; end; end;
		if self.currentPuntaSxB == 24 then                                                                                                                                  if self.currentPosDirB == -1 and self.pos11 == true then self:setcurrentPuntaSxB(21); self.pos12 = true; self.pos11 = false; end; end;
	if self.positions > 12 then 
		if self.currentPuntaSxB == 24 then if self.currentPosDirB == 1 and self.pos13 == true then self:setcurrentPuntaSxB(25); self.pos12 = true; self.pos13 = false; end; end;
		if self.currentPuntaSxB == 26 then if self.currentPosDirB == 1 and self.pos14 == true then self:setcurrentPuntaSxB(27); self.pos13 = true; self.pos14 = false; end; if self.currentPosDirB == -1 and self.pos12 == true then self:setcurrentPuntaSxB(23); self.pos13 = true; self.pos12 = false; end; end;
		if self.currentPuntaSxB == 28 then if self.currentPosDirB == 1 and self.pos15 == true then self:setcurrentPuntaSxB(29); self.pos14 = true; self.pos15 = false; end; if self.currentPosDirB == -1 and self.pos13 == true then self:setcurrentPuntaSxB(25); self.pos14 = true; self.pos13 = false; end; end;
		if self.currentPuntaSxB == 30 then if self.currentPosDirB == 1 and self.pos16 == true then self:setcurrentPuntaSxB(31); self.pos15 = true; self.pos16 = false; end; if self.currentPosDirB == -1 and self.pos14 == true then self:setcurrentPuntaSxB(27); self.pos15 = true; self.pos14 = false; end; end;
		if self.currentPuntaSxB == 32 then if self.currentPosDirB == 1 and self.pos17 == true then self:setcurrentPuntaSxB(33); self.pos16 = true; self.pos17 = false; end; if self.currentPosDirB == -1 and self.pos15 == true then self:setcurrentPuntaSxB(29); self.pos16 = true; self.pos15 = false; end; end;
		if self.currentPuntaSxB == 34 then if self.currentPosDirB == 1 and self.pos18 == true then self:setcurrentPuntaSxB(35); self.pos17 = true; self.pos18 = false; end; if self.currentPosDirB == -1 and self.pos16 == true then self:setcurrentPuntaSxB(31); self.pos17 = true; self.pos16 = false; end; end;
		if self.currentPuntaSxB == 36 then if self.currentPosDirB == 1 and self.pos19 == true then self:setcurrentPuntaSxB(37); self.pos18 = true; self.pos19 = false; end; if self.currentPosDirB == -1 and self.pos17 == true then self:setcurrentPuntaSxB(33); self.pos18 = true; self.pos17 = false; end; end;
		if self.currentPuntaSxB == 38 then if self.currentPosDirB == 1 and self.pos20 == true then self:setcurrentPuntaSxB(39); self.pos19 = true; self.pos20 = false; end; if self.currentPosDirB == -1 and self.pos18 == true then self:setcurrentPuntaSxB(35); self.pos19 = true; self.pos18 = false; end; end;
		if self.currentPuntaSxB == 40 then if self.currentPosDirB == 1 and self.pos21 == true then self:setcurrentPuntaSxB(41); self.pos20 = true; self.pos21 = false; end; if self.currentPosDirB == -1 and self.pos19 == true then self:setcurrentPuntaSxB(37); self.pos20 = true; self.pos19 = false; end; end;
		if self.currentPuntaSxB == 42 then if self.currentPosDirB == 1 and self.pos22 == true then self:setcurrentPuntaSxB(43); self.pos21 = true; self.pos22 = false; end; if self.currentPosDirB == -1 and self.pos20 == true then self:setcurrentPuntaSxB(39); self.pos21 = true; self.pos20 = false; end; end;
		if self.currentPuntaSxB == 44 then if self.currentPosDirB == 1 and self.pos23 == true then self:setcurrentPuntaSxB(45); self.pos22 = true; self.pos23 = false; end; if self.currentPosDirB == -1 and self.pos21 == true then self:setcurrentPuntaSxB(41); self.pos22 = true; self.pos21 = false; end; end;
		if self.currentPuntaSxB == 46 then if self.currentPosDirB == 1 and self.pos24 == true then self:setcurrentPuntaSxB(47); self.pos23 = true; self.pos24 = false; end; if self.currentPosDirB == -1 and self.pos22 == true then self:setcurrentPuntaSxB(43); self.pos23 = true; self.pos22 = false; end; end;
		if self.currentPuntaSxB == 48 then                                                                                                                                  if self.currentPosDirB == -1 and self.pos23 == true then self:setcurrentPuntaSxB(45); self.pos24 = true; self.pos23 = false; end; end;
	end; self.currentPosDirB = 0; end;
	if self.currentPuntaDxB == 1 or self.currentPuntaDxB == 3 or self.currentPuntaDxB == 5 or self.currentPuntaDxB == 7 or self.currentPuntaDxB == 9 or self.currentPuntaDxB == 11 or self.currentPuntaDxB == 13 or self.currentPuntaDxB == 15 or self.currentPuntaDxB == 17 or self.currentPuntaDxB == 19 or self.currentPuntaDxB == 21 or self.currentPuntaDxB == 23 
	or self.currentPuntaDxB == 25 or self.currentPuntaDxB == 27 or self.currentPuntaDxB == 29 or self.currentPuntaDxB == 31 or self.currentPuntaDxB == 33 or self.currentPuntaDxB == 35 or self.currentPuntaDxB == 37 or self.currentPuntaDxB == 39 or self.currentPuntaDxB == 41 or self.currentPuntaDxB == 43 or self.currentPuntaDxB == 45 or self.currentPuntaDxB == 47 
	then self.currentPuntaDxB = self.currentPuntaDxB + 1; setTranslation(self.punteDxB, self.currentPuntaDxB/2*self.dist-self.distCB, 0, 0); end;
	if self.currentPuntaSxB == 1 or self.currentPuntaSxB == 3 or self.currentPuntaSxB == 5 or self.currentPuntaSxB == 7 or self.currentPuntaSxB == 9 or self.currentPuntaSxB == 11 or self.currentPuntaSxB == 13 or self.currentPuntaSxB == 15 or self.currentPuntaSxB == 17 or self.currentPuntaSxB == 19 or self.currentPuntaSxB == 21 or self.currentPuntaSxB == 23 
	or self.currentPuntaSxB == 25 or self.currentPuntaSxB == 27 or self.currentPuntaSxB == 29 or self.currentPuntaSxB == 31 or self.currentPuntaSxB == 33 or self.currentPuntaSxB == 35 or self.currentPuntaSxB == 37 or self.currentPuntaSxB == 39 or self.currentPuntaSxB == 41 or self.currentPuntaSxB == 43 or self.currentPuntaSxB == 45 or self.currentPuntaSxB == 47
	then self.currentPuntaSxB = self.currentPuntaSxB + 1; setTranslation(self.punteSxB, self.currentPuntaSxB/2*self.dist-self.distCB, 0, 0); end;
	if self.currentPuntePalletB == 3 then setTranslation(self.fermiDxB, self.currentPuntaDxB/2*self.dist-self.distCB, 0.785, 0.084); end;
	if self.currentPuntePalletB == 7 then setTranslation(self.fermiSxB, self.currentPuntaSxB/2*self.dist-self.distCB, 0.785, 0.084); end; end;
function variablePuntePalletB:onAttach(attacherVehicle, jointDescIndex) end;
function variablePuntePalletB:onDetach() self.speedViolationTimerPunte = self.speedViolationMaxTimePunte; end;
function variablePuntePalletB:draw() end;
setcurrentPuntePalletBEvent = {}; setcurrentPuntePalletBEvent_mt = Class(setcurrentPuntePalletBEvent, Event); InitEventClass(setcurrentPuntePalletBEvent, "setcurrentPuntePalletBEvent");
function setcurrentPuntePalletBEvent:emptyNew() local self = Event:new(setcurrentPuntePalletBEvent_mt); self.className="setcurrentPuntePalletBEvent"; return self; end;
function setcurrentPuntePalletBEvent:new(vehicle, currentPuntePalletB) local self = setcurrentPuntePalletBEvent:emptyNew() self.vehicle = vehicle; self.currentPuntePalletB = currentPuntePalletB; return self; end;
function setcurrentPuntePalletBEvent:readStream(streamId, connection) local id = streamReadInt32(streamId); self.vehicle = networkGetObject(id); self.currentPuntePalletB = streamReadInt8(streamId); self.vehicle:setcurrentPuntePalletB(self.currentPuntePalletB, true);
	if not connection:getIsServer() then g_server:broadcastEvent(setcurrentPuntePalletBEvent:new(self.vehicle, self.currentPuntePalletB), nil, connection, self.vehicle); end; end;
function setcurrentPuntePalletBEvent:writeStream(streamId, connection) streamWriteInt32(streamId, networkGetObjectId(self.vehicle)); streamWriteInt8(streamId, self.currentPuntePalletB); end;
function setcurrentPuntePalletBEvent.sendEvent(vehicle, currentPuntePalletB, noEventSend)	if noEventSend == nil or noEventSend == false then
	if g_server ~= nil then	g_server:broadcastEvent(setcurrentPuntePalletBEvent:new(vehicle, currentPuntePalletB), nil, nil, vehicle);
	else g_client:getServerConnection():sendEvent(setcurrentPuntePalletBEvent:new(vehicle, currentPuntePalletB)); end; end; end;
setcurrentPosDirBEvent = {}; setcurrentPosDirBEvent_mt = Class(setcurrentPosDirBEvent, Event); InitEventClass(setcurrentPosDirBEvent, "setcurrentPosDirBEvent");
function setcurrentPosDirBEvent:emptyNew() local self = Event:new(setcurrentPosDirBEvent_mt); self.className="setcurrentPosDirBEvent"; return self; end;
function setcurrentPosDirBEvent:new(vehicle, currentPosDirB) local self = setcurrentPosDirBEvent:emptyNew() self.vehicle = vehicle; self.currentPosDirB = currentPosDirB; return self; end;
function setcurrentPosDirBEvent:readStream(streamId, connection) local id = streamReadInt32(streamId); self.vehicle = networkGetObject(id); self.currentPosDirB = streamReadInt8(streamId); if self.vehicle ~= nil then self.vehicle:setcurrentPosDirB(self.currentPosDirB, true); end;
	if not connection:getIsServer() then g_server:broadcastEvent(setcurrentPosDirBEvent:new(self.vehicle, self.currentPosDirB), nil, connection, self.vehicle); end; end;
function setcurrentPosDirBEvent:writeStream(streamId, connection) streamWriteInt32(streamId, networkGetObjectId(self.vehicle)); streamWriteInt8(streamId, self.currentPosDirB); end;
function setcurrentPosDirBEvent.sendEvent(vehicle, currentPosDirB, noEventSend)	if noEventSend == nil or noEventSend == false then
	if g_server ~= nil then	g_server:broadcastEvent(setcurrentPosDirBEvent:new(vehicle, currentPosDirB), nil, nil, vehicle);
	else g_client:getServerConnection():sendEvent(setcurrentPosDirBEvent:new(vehicle, currentPosDirB)); end; end; end;
setcurrentPuntaDxBEvent = {}; setcurrentPuntaDxBEvent_mt = Class(setcurrentPuntaDxBEvent, Event); InitEventClass(setcurrentPuntaDxBEvent, "setcurrentPuntaDxBEvent");
function setcurrentPuntaDxBEvent:emptyNew() local self = Event:new(setcurrentPuntaDxBEvent_mt); self.className="setcurrentPuntaDxBEvent"; return self; end;
function setcurrentPuntaDxBEvent:new(vehicle, currentPuntaDxB) local self = setcurrentPuntaDxBEvent:emptyNew() self.vehicle = vehicle; self.currentPuntaDxB = currentPuntaDxB; return self; end;
function setcurrentPuntaDxBEvent:readStream(streamId, connection) local id = streamReadInt32(streamId); self.vehicle = networkGetObject(id); self.currentPuntaDxB = streamReadInt8(streamId); self.vehicle:setcurrentPuntaDxB(self.currentPuntaDxB, true);
	if not connection:getIsServer() then g_server:broadcastEvent(setcurrentPuntaDxBEvent:new(self.vehicle, self.currentPuntaDxB), nil, connection, self.vehicle); end; end;
function setcurrentPuntaDxBEvent:writeStream(streamId, connection) streamWriteInt32(streamId, networkGetObjectId(self.vehicle)); streamWriteInt8(streamId, self.currentPuntaDxB); end;
function setcurrentPuntaDxBEvent.sendEvent(vehicle, currentPuntaDxB, noEventSend)	if noEventSend == nil or noEventSend == false then
	if g_server ~= nil then	g_server:broadcastEvent(setcurrentPuntaDxBEvent:new(vehicle, currentPuntaDxB), nil, nil, vehicle);
	else g_client:getServerConnection():sendEvent(setcurrentPuntaDxBEvent:new(vehicle, currentPuntaDxB)); end; end; end;
setcurrentPuntaSxBEvent = {}; setcurrentPuntaSxBEvent_mt = Class(setcurrentPuntaSxBEvent, Event); InitEventClass(setcurrentPuntaSxBEvent, "setcurrentPuntaSxBEvent");
function setcurrentPuntaSxBEvent:emptyNew() local self = Event:new(setcurrentPuntaSxBEvent_mt); self.className="setcurrentPuntaSxBEvent"; return self; end;
function setcurrentPuntaSxBEvent:new(vehicle, currentPuntaSxB) local self = setcurrentPuntaSxBEvent:emptyNew() self.vehicle = vehicle; self.currentPuntaSxB = currentPuntaSxB; return self; end;
function setcurrentPuntaSxBEvent:readStream(streamId, connection) local id = streamReadInt32(streamId); self.vehicle = networkGetObject(id); self.currentPuntaSxB = streamReadInt8(streamId); self.vehicle:setcurrentPuntaSxB(self.currentPuntaSxB, true);
	if not connection:getIsServer() then g_server:broadcastEvent(setcurrentPuntaSxBEvent:new(self.vehicle, self.currentPuntaSxB), nil, connection, self.vehicle); end; end;
function setcurrentPuntaSxBEvent:writeStream(streamId, connection) streamWriteInt32(streamId, networkGetObjectId(self.vehicle)); streamWriteInt8(streamId, self.currentPuntaSxB); end;
function setcurrentPuntaSxBEvent.sendEvent(vehicle, currentPuntaSxB, noEventSend)	if noEventSend == nil or noEventSend == false then
	if g_server ~= nil then	g_server:broadcastEvent(setcurrentPuntaSxBEvent:new(vehicle, currentPuntaSxB), nil, nil, vehicle);
	else g_client:getServerConnection():sendEvent(setcurrentPuntaSxBEvent:new(vehicle, currentPuntaSxB)); end; end; end;