.:HyPeX:. Posted March 25, 2014 Share Posted March 25, 2014 Ya lo eh posteado en ingles, quizas alguien en español me pueda ayudar, no se selecciona Engineer, pero todas las demas si, y no encuentro el error. function DeployMetClick(button, state) if state == "up" then return end local CursorX, CursorY = getCursorPosition() if CursorX > 0.79 and CursorY > 0.917 then if CursorX < 0.96 and CursorY < 0.96 then Deploy() outputConsole("DEPLOYED") end end if CursorX > 0.00600 and CursorY > 0.809 then if CursorX < 0.07050 and CursorY < 0.898 then setElementData(getLocalPlayer(), "Class", "Medic") outputConsole("Medic") end end if CursorX > 0.07426 and CursorY > 0.8098 then if CursorX < 0.01367 and CursorY < 0.8971 then setElementData(getLocalPlayer(), "Class", "Engineer") outputConsole("Engineer") end end if CursorX > 0.14100 and CursorY > 0.809 then if CursorX < 0.20400 and CursorY < 0.898 then setElementData(getLocalPlayer(), "Class", "Assault") outputConsole("Assault") end end if CursorX > 0.20800 and CursorY > 0.809 then if CursorX < 0.27100 and CursorY < 0.898 then setElementData(getLocalPlayer(), "Class", "Sniper") outputConsole("Sniper") end end end addEventHandler("onClientClick", getRootElement(), DeployMetClick) Link to comment
Tomas Posted March 25, 2014 Share Posted March 25, 2014 Ya lo eh posteado en ingles, quizas alguien en español me pueda ayudar, no se selecciona Engineer, pero todas las demas si, y no encuentro el error. function DeployMetClick(button, state) if state == "up" then return end local CursorX, CursorY = getCursorPosition() if CursorX > 0.79 and CursorY > 0.917 then if CursorX < 0.96 and CursorY < 0.96 then Deploy() outputConsole("DEPLOYED") end end if CursorX > 0.00600 and CursorY > 0.809 then if CursorX < 0.07050 and CursorY < 0.898 then setElementData(getLocalPlayer(), "Class", "Medic") outputConsole("Medic") end end if CursorX > 0.07426 and CursorY > 0.8098 then if CursorX < 0.01367 and CursorY < 0.8971 then setElementData(getLocalPlayer(), "Class", "Engineer") outputConsole("Engineer") end end if CursorX > 0.14100 and CursorY > 0.809 then if CursorX < 0.20400 and CursorY < 0.898 then setElementData(getLocalPlayer(), "Class", "Assault") outputConsole("Assault") end end if CursorX > 0.20800 and CursorY > 0.809 then if CursorX < 0.27100 and CursorY < 0.898 then setElementData(getLocalPlayer(), "Class", "Sniper") outputConsole("Sniper") end end end addEventHandler("onClientClick", getRootElement(), DeployMetClick) Al seleccionar Enginer, algun debug? Link to comment
Alexs Posted March 25, 2014 Share Posted March 25, 2014 La variable 'CursorX' no puede ser, al mismo tiempo, mayor a 0.07426 y menor que 0.01367. Link to comment
.:HyPeX:. Posted March 25, 2014 Author Share Posted March 25, 2014 La variable 'CursorX' no puede ser, al mismo tiempo, mayor a 0.07426 y menor que 0.01367. Que raro, la copie exactamente como me la setio al clipboard mi función, vere de buscarlas denuevo. Link to comment
Alexs Posted March 25, 2014 Share Posted March 25, 2014 Deberías intentar, ademas, reacomodar (acortar) la función para hacerla mas eficiente. Link to comment
Recommended Posts