GonzaloBuenosAires Posted September 2, 2017 Share Posted September 2, 2017 No entiendo los boolean de aqui que está pasando con estas funciones????... -------------------------------- function aliento () if getElementData(getLocalPlayer(), "blood") <= 5000 and not getElementData(getLocalPlayer(), "isDead") == true then ------ attempt to comparare boolean with number ---Error aqui--- local Zx,Zy,Zz = getElementPosition( ped ) local randnum = math.random(1,5) local sound = playSound("sounds/aliento"..randnum..".ogg", Zx, Zy, Zz, false) setSoundMaxDistance(sound, 20) end end setTimer(aliento, 10000, 0) function suspenso () if getElementData(getLocalPlayer(), "blood") <= 3000 and not getElementData(getLocalPlayer(), "isDead") == true then ------ attempt to comparare boolean with number ---Error aqui--- local Zx,Zy,Zz = getElementPosition( ped ) local sound = playSound("sounds/suspenso.ogg", Zx, Zy, Zz, false) setSoundMaxDistance(sound, 20) end end setTimer(suspenso, 9000, 0) local screenX, screenY = guiGetScreenSize() local screenSource = dxCreateScreenSource(screenX, screenY) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() if getVersion ().sortable < "1.1.0" then return else blackWhiteShader, blackWhiteTec = dxCreateShader("fx/blackwhite.fx") if (not blackWhiteShader) then else end end end) addEventHandler("onClientPreRender", getRootElement(), function() if getElementData(getLocalPlayer(), "blood") <= 5000 and not getElementData(getLocalPlayer(), "isDead") == true then ------ attempt to comparare boolean with number ---Error aqui--- dxUpdateScreenSource(screenSource) dxSetShaderValue(blackWhiteShader, "screenSource", screenSource) dxDrawImage(0, 0, screenX, screenY, blackWhiteShader) end end) -------------------------- Link to comment
TheCrazy17 Posted September 2, 2017 Share Posted September 2, 2017 Esos errores pasan por que no tienes el elemento "blood" asignado aún, para arreglarlo simplemente puedes comprobar si el dato ya está asignado, agregando algo así: if getElementData(localPlayer, "blood") and getElementData(getLocalPlayer(), "blood") <= 5000 and not getElementData(getLocalPlayer(), "isDead") == true then Link to comment
GonzaloBuenosAires Posted September 2, 2017 Author Share Posted September 2, 2017 3 hours ago, TheCrazy17 said: Esos errores pasan por que no tienes el elemento "blood" asignado aún, para arreglarlo simplemente puedes comprobar si el dato ya está asignado, agregando algo así: if getElementData(localPlayer, "blood") and getElementData(getLocalPlayer(), "blood") <= 5000 and not getElementData(getLocalPlayer(), "isDead") == true then Agregue la linea que me pasaste en cada error y en el debugscript 3 ni un error me dió, muchas gracias!!!!!.... Link to comment
GonzaloBuenosAires Posted September 2, 2017 Author Share Posted September 2, 2017 4 hours ago, TheCrazy17 said: Esos errores pasan por que no tienes el elemento "blood" asignado aún, para arreglarlo simplemente puedes comprobar si el dato ya está asignado, agregando algo así: if getElementData(localPlayer, "blood") and getElementData(getLocalPlayer(), "blood") <= 5000 and not getElementData(getLocalPlayer(), "isDead") == true then Te pido una ultima ayudita y no te molesto más.... En esta función tengo estos dos warning: ---------------------------- function showDayZDeathScreen() setTimer(fadeCamera, 1000, 1, true, 1.5) deadBackground = guiCreateStaticImage(0, 0, 1, 1, "images/dead.jpg", true) deathText = guiCreateLabel(0, 0.8, 1, 0.2, [[ ¡Estas Muerto! Reaparecerás en 5 segundos.]], true) guiLabelSetHorizontalAlign(deathText, "center") setTimer(guiSetVisible, 5000, 1, false) --- Bad argument @ guiSetvisible Expected gui- element at argument 1, got booolean -- setTimer(guiSetVisible, 5000, 1, false) -- Bad argument @ guiSetvisible Expected gui- element at argument 1, got booolean -- setTimer(destroyElement, 5000, 1, deathText) setTimer(destroyElement, 5000, 1, deadBackground) end ------------------------------------------------ Link to comment
TheCrazy17 Posted September 2, 2017 Share Posted September 2, 2017 (edited) Simplemente borra esas dos lineas que dan error, no son necesarias ahí, ya que se destruyen ambos elementos mas abajo. Edited September 2, 2017 by TheCrazy17 Link to comment
GonzaloBuenosAires Posted September 2, 2017 Author Share Posted September 2, 2017 6 minutes ago, TheCrazy17 said: Simplemente borra esas dos lineas que dan error, no son necesarias ahí, ya que se destruyen ambos elementos mas abajo. Gracias funciono!!! Te pasas por esto??? Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now