PhantomDamn Posted January 24, 2014 Share Posted January 24, 2014 Esto me tira error: gateList = {} gateListMoveToX = {} gateListMoveToY = {} gateListMoveToZ = {} gateListMoveTorX = {} gateListMoveTorY = {} gateListMoveTorZ = {} function moveBack(index, x,y,z, raising) if status[index] == 1 then status[index] = 2 moveObject ( gateList[index], 2000, x,y,z, gateListMoveTorX[gateIndex],gateListMoveTorY[gateIndex],gateListMoveTorZ[gateIndex],rx,ry,rz ) setTimer ( resetTimer, 2000, 1, index ) end end ERROR:'move' [Expected easing-type at argumen 9, got numer '0' ] PD: el error esta en la linea 14. alguna idea de porque? o quiza algo que ya la nueva version no reconoce... Link to comment
MTA Team 0xCiBeR Posted January 24, 2014 MTA Team Share Posted January 24, 2014 Lo que te esta indicando es que se topo con un error que significa que en ves de encontrase con un easing-type se encontro con un numero. Mira los argumentos de esa función: bool moveObject ( object theObject, int time, float targetx, float targety, float targetz, [ float moverx, float movery, float moverz, string strEasingType, float fEasingPeriod, float fEasingAmplitude, float fEasingOvershoot ] ) Link to comment
PhantomDamn Posted January 24, 2014 Author Share Posted January 24, 2014 Ese es el ejemplo de la wiki, pero el unico numero que veo es el "2000" y supongo que tambn hace referencia del 2000 del setTimer que se encuentra debajo... por si quiza no haya puesto todo lo que refiere al error me asegurare de pegar todo el script : gateList = {} gateListMoveToX = {} gateListMoveToY = {} gateListMoveToZ = {} gateListMoveTorX = {} gateListMoveTorY = {} gateListMoveTorZ = {} shapes = {} team = {} temp = {} status = {} -- 0 = not moving. 1 = moving to open. 2 = moving to close function checkClass(hitElement, matchingDimension) if ( getElementType(hitElement) == "vehicle" ) then hitElement = getVehicleController(hitElement) end for i=0,#gateList do local name = getTeamName(getPlayerTeam(hitElement)) if(name == false) then name = "false" end if ( name == team[i] or name == "true") then detection = isElementWithinColShape ( hitElement, shapes[i] ) if detection == true then move(i, false) end end end end function loadup(startedResource) gates = xmlLoadFile ( "gates.xml" ) count = xmlNodeGetChildren(gates) for i=1,#count do local gate = xmlFindChild ( gates, "gate", i-1 ) local attributes = xmlNodeGetAttributes ( gate ) for name,value in pairs ( attributes ) do temp["" .. name .. ""] = value end gateList[i] = createObject(temp["objectID"], temp["x"], temp["y"], temp["z"], temp["rx"], temp["ry"], temp["rz"]) gateListMoveToX[i] = temp["x2"] gateListMoveToY[i] = temp["y2"] gateListMoveToZ[i] = temp["z2"] gateListMoveTorX[i] = temp["rx2"] gateListMoveTorY[i] = temp["ry2"] gateListMoveTorZ[i] = temp["rz2"] outputDebugString("" .. temp["objectID"] .. "") shapes[i] = createColRectangle(temp["collisionx"], temp["collisionY"], temp["collisionZ"], temp["collisionSize"],temp["collisionSize"]) team[i] = temp["team"] setElementInterior(gateList[i], temp["interiorID"]) status[i] = 0 addEventHandler ( "onColShapeHit", shapes[i], checkClass ) end xmlUnloadFile ( gates ) end function move(gateIndex, rotate) -- 0 = not moving. 1 = moving to open. 2 = moving to close outputDebugString("moving..") x,y,z = getElementPosition(gateList[gateIndex]) rx,ry,rz = getObjectRotation(gateList[gateIndex]) if status[gateIndex] == 0 then moveObject ( gateList[gateIndex], 2000, gateListMoveToX[gateIndex], gateListMoveToY[gateIndex],gateListMoveToZ[gateIndex]) status[gateIndex] = 1 setTimer ( moveBack, 3000, 1,gateIndex, x,y,z,rx,ry,rz, raising ) end end function moveBack(index, x,y,z, raising) if status[index] == 1 then status[index] = 2 moveObject ( gateList[index], 2000, x,y,z, gateListMoveTorX[gateIndex],gateListMoveTorY[gateIndex],gateListMoveTorZ[gateIndex],rx,ry,rz ) setTimer ( resetTimer, 2000, 1, index ) end end function resetTimer(index) status[index] = 0 end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), loadup ) Este es el archivo "New_gatemaker" https://community.multitheftauto.com/index.php?p=resources&s=details&id=3949 Link to comment
MTA Team 0xCiBeR Posted January 24, 2014 MTA Team Share Posted January 24, 2014 rx,ry,rz son los valores que le estan dando number donde deberia haber un easing-type. Te puse el ejemplo de la wiki, asi contas cuantos valores tenes hasta el easing-type, en el cual se ubica en el 9 argumento, o sea que rx,ry,rz estan causando que de 0. No se si me explico Esto: function moveBack(index, x,y,z, raising) if status[index] == 1 then status[index] = 2 moveObject ( gateList[index], 2000, x,y,z, gateListMoveTorX[gateIndex],gateListMoveTorY[gateIndex],gateListMoveTorZ[gateIndex],rx,ry,rz ) setTimer ( resetTimer, 2000, 1, index ) end end Debería ser esto: function moveBack(index, x,y,z, raising) if status[index] == 1 then status[index] = 2 moveObject ( gateList[index], 2000, x,y,z, gateListMoveTorX[gateIndex],gateListMoveTorY[gateIndex],gateListMoveTorZ[gateIndex] ) setTimer ( resetTimer, 2000, 1, index ) end end Link to comment
MTA Team 0xCiBeR Posted January 24, 2014 MTA Team Share Posted January 24, 2014 De nada. Link to comment
Recommended Posts