-
Posts
123 -
Joined
-
Last visited
Everything posted by AlvarO
-
Didn't understand, can you give me an example?
-
I tested it and now appear a black background dxDrawImage(0, 0, x, y, blurShader, 0, 0, 0, tocolor(255, 255, 255, 150))
-
It depends of your monitor resolution, I have 27" and it is 1920 x 1080
-
I made this and it dosn't works local x, y = guiGetScreenSize() local px, py = 1920, 1080 local sx, sy = (x/px), (y/py) screen = dxCreateScreenSource ( px, py ) function drawLogin() dxUpdateScreenSource( screen ) blurShader = dxCreateShader( "shader.fx" ) dxSetShaderValue( blurShader, "bShowThing", true ) dxSetShaderValue( blurShader, "speed", 2.4 ) dxSetShaderValue( blurShader, "positionOfCheese", 100, 200, 300 ) setCameraMatrix(4141.2734375, -1625.0224609375, 72.958938598633, -300000, 0, 0) showCursor(true) dxDrawRectangle(x*0.385, y*0.35, 450, 50, tocolor(170, 35, 35, 255)) dxDrawRectangle(x*0.385, y*0.38, 450, 250, tocolor(255, 255, 255, 255)) dxDrawRectangle(x*0.385, y*0.6, 450, 50, tocolor(200, 200, 200, 255)) dxDrawRectangle(x*0.48, y*0.613, 100, 25, rectanglecchanger1) dxDrawRectangle(x*0.55, y*0.613, 100, 25, rectanglecchanger2) dxDrawText("Login panel", x*(-0.15), x*(-0.15), x, y, tocolor(15, 15, 15, 255), 1.5, "arial", "center", "center", false, false, true, true, false) dxDrawText("Username", x*(-0.15), y*(-0.15), x, y, tocolor(15, 15, 15, 255), 1.5, "arial", "center", "center", false, false, true, true, false) dxDrawText("Password", x*(-0.15), y*0.01, x, y, tocolor(15, 15, 15, 255), 1.5, "arial", "center", "center", false, false, true, true, false) dxDrawText("remember me?", x*(-0.1), x*0.14, x, y, tocolor(15, 15, 15, 255), 1, "arial", "center", "center", false, false, true, true, false) dxDrawText("Login", x*0.01, x*0.14, x, y, tocolor(15, 15, 15, 255), 1, "arial", "center", "center", false, false, true, true, false) dxDrawText("Register", x*0.152, x*0.14, x, y, tocolor(15, 15, 15, 255), 1, "arial", "center", "center", false, false, true, true, false) end addEventHandler("onClientRender", root, drawLogin)
-
Hello, so I need to make a blur background to a script, the problem is i don't know how to script it, I just got the .fx file. texture texture0; float factor; sampler Sampler0 = sampler_state { Texture = (texture0); AddressU = MIRROR; AddressV = MIRROR; }; struct PSInput { float2 TexCoord : TEXCOORD0; }; float4 PixelShader_Background(PSInput PS) : COLOR0 { float4 sum = tex2D(Sampler0, PS.TexCoord); for (float i = 1; i < 3; i++) { sum += tex2D(Sampler0, float2(PS.TexCoord.x, PS.TexCoord.y + (i * factor))); sum += tex2D(Sampler0, float2(PS.TexCoord.x, PS.TexCoord.y - (i * factor))); sum += tex2D(Sampler0, float2(PS.TexCoord.x - (i * factor), PS.TexCoord.y)); sum += tex2D(Sampler0, float2(PS.TexCoord.x + (i * factor), PS.TexCoord.y)); } sum /= 9; sum.a = 1.0; return sum; } technique complercated { pass P0 { PixelShader = compile ps_2_0 PixelShader_Background(); } } technique simple { pass P0 { Texture[0] = texture0; } }
-
Well, I think you didn't get the idea, I want that when a ADMIN player writes the command and the sound, the sound reproduces, and when the player is NOT admin, output the message.
-
start = getTickCount() function loading () local now = getTickCount() with = interpolateBetween(0,0,0,532,0,0, (now - start) / (( start + 10000 ) - start ) , "Linear" ) dxDrawRectangle(142, 222, 532, 41, tocolor(0, 0, 0, 255), false) dxDrawRectangle(142, 222, with, 41, tocolor(55, 215, 0, 255), false) end end addEventHandler("onClientRender",root,lodaing) bindKey("c","down",function () local now = getTickCount() start = getTickCount() with = interpolateBetween(with,0,0,0,0,0, (now - start) / (( start + 3000 ) - start ) , "Linear" ) givePlayerMoney(5000) end)
-
CLIENT sounds = { shutup = {"sound/ahahshutup.mp3", "Shut up!"}, airhorn = {"sound/airhorn.wav", "Air horn!"}, amazing = {"sound/AMAZING.WAV", "AMAZING!"}, andwheni = {"sound/andwheni.mp3", "And when I say jump, you say, how high?"}, apologize = {"sound/apologize.mp3", "Apologize!"}, blew = {"sound/blew.mp3", "Blew!"}, hello1 = {"sound/HELLO.WAV", "Hello!"}, hello2 = {"sound/HelloNoob.mp3", "Hello noob!"}, } local sonidos = {} for k,sound in ipairs(getElementsByType("sound")) do table.insert(sonidos,sound) end function playSounds( cmd, type, sound) if type then if getElementsByType("sound") then outputChatBox("A sound has been played by: "..getPlayerName(localPlayer).." #ffffff[#ad2525"..sounds[type][2].."#ffffff]", 255, 255, 255, true) sonido = playSound(sounds[type][1]) end end end addEvent("onStartSound", true) addEventHandler("onStartSound", root, playSounds) addEventHandler("onClientResourceStart", getRootElement(), playSounds) SERVER function funcionDeSaberSiEsAdmin(client) local pAccount = getPlayerAccount(client) local accName = getAccountName(pAccount) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then triggerClientEvent ( client, "onStartSound", client) else outputChatBox("You're not admin!", getRootElement(), 255, 0, 0) end end addCommandHandler("sound", funcionDeSaberSiEsAdmin) Nothing in debug, and sound is not reproduced, help?
-
Still dosnt working, in my script, when i click in login, it repeat the same animation as when the script starts :c
-
I'm making that when a player clicks, interpolate moves again, but it makes the animation of the start, help please. local x, y = guiGetScreenSize() local px, py = 1920, 1080 local sx, sy = (x/py), (y/py) local start = getTickCount() local font = dxCreateFont("font.ttf", 52, false) function drawingLogin() now = getTickCount() ax, ay = interpolateBetween(x*0.06, y*0.4,0,x*0.06, y*0.47,0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax2, ay2 = interpolateBetween(x*0.37, y*0.4,0,x*0.37, y*0.47,0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax3, ay3 = interpolateBetween(x*0.37, y*0.4,0,x*0.37, y*0.57,0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax4, ay4 = interpolateBetween(x*0.52, y*0.4,0,x*0.52, y*0.47,0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax5, ay5 = interpolateBetween(x*0.6, y*0.4,0,x*0.6, y*0.47,0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax6, ay6 = interpolateBetween(x*(-0.18),y*0.2,0,x*(-0.18),y*0.24,0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax7, ay7 = interpolateBetween(x*0.36,y*0.4,0,x*0.36,y*0.44,0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax8, ay8 = interpolateBetween(x*0.91, y*0.2, 0, x*0.91, y*0.24, 0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax9, ay9 = interpolateBetween(x*0.38, y*0.465, 0, x*0.38, y*0.475, 0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax10, ay10 = interpolateBetween(x*0.532, y*0.465, 0, x*0.532, y*0.475, 0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) dxDrawImage(0, 0, x, y, "img/background.png") dxDrawImage(ax9, ay9, 60, 60, "img/login.png") dxDrawImage(ax10, ay10, 60, 60, "img/register.png") dxDrawRectangle(ax, ay, x*0.2867, y*0.07, cambiarCoolor1, false) dxDrawRectangle(ax2, ay2,x*0.05, y*0.07, cambiarCoolor1, false) dxDrawRectangle(ax3, ay3,x*0.2, y*0.07, cambiarCoolor3, false) dxDrawRectangle(ax4, ay4, x*0.05, y*0.07, cambiarCoolor2, false) dxDrawRectangle(ax5, ay5, x*0.2867, y*0.07, cambiarCoolor2, false) dxDrawText("SIGN IN", ax6, ay6, x/2-300/2+160+140, y*0.73+40, tocolor(255, 255, 255, 255), 0.5, font, "center", "center", false, false, true, true, false) dxDrawText("PLAY AS GUEST", ax7, ay7, x/2-300/2+160+140, y*0.73+40, tocolor(255, 255, 255, 255), 0.5, font, "center", "center", false, false, true, true, false) dxDrawText("ADD NEW ACCOUNT", ax8, ay8, x/2-300/2+160+140, y*0.73+40, tocolor(255, 255, 255, 255), 0.5, font, "center", "center", false, false, true, true, false) showChat(false) showCursor(true) end addEventHandler("onPlayerJoin", root, drawingLogin) addEventHandler("onClientRender", root, drawingLogin) --Botones function guestPlayer (button, state, absoluteX, absoluteY, wx, wy, wz, clickedElement) if state == "down" then if isCursorHover (x*0.37, y*0.57,x*0.2, y*0.07) then removeEventHandler("onClientRender", getRootElement(), drawingLogin) showChat(true) showCursor(false) end end end addEventHandler ("onClientClick", getRootElement(), guestPlayer) function hideLogin (button, state, absoluteX, absoluteY, wx, wy, wz, clickedElement) if state == "down" then if isCursorHover (x*0.06, y*0.47, x*0.2867, y*0.07) then start = getTickCount() ax, ay = interpolateBetween(x*0.06, y*0.47,0,x*0.06, y*0.9, 0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax2, ay2 = interpolateBetween(x*0.37, y*0.4,0,x*0.37, y*0.9,0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax3, ay3 = interpolateBetween(x*0.37, y*0.4,0,x*0.37, y*0.9,0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax4, ay4 = interpolateBetween(x*0.52, y*0.4,0,x*0.52, y*0.9,0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax5, ay5 = interpolateBetween(x*0.6, y*0.4,0,x*0.6, y*0.9,0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax6, ay6 = interpolateBetween(x*(-0.18),y*0.2,0,x*(-0.18),y*0.9,0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax7, ay7 = interpolateBetween(x*0.36,y*0.4,0,x*0.36,y*0.9,0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax8, ay8 = interpolateBetween(x*0.91, y*0.2, 0, x*0.91, y*0.9, 0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax9, ay9 = interpolateBetween(x*0.38, y*0.465, 0, x*0.38, y*0.9, 0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) ax10, ay10 = interpolateBetween(x*0.532, y*0.465, 0, x*0.532, y*0.9, 0, (now - start) / (( start + 400 ) - start ) , "InOutBounce" ) end end end addEventHandler("onClientRender", root, hideLogin) addEventHandler ("onClientClick", getRootElement(), hideLogin) --Cambiar colores function cambiarColor() if isCursorHover(x*0.06, y*0.47, x*0.2867, y*0.07) then cambiarCoolor1 = tocolor(255, 255, 255, 125) else cambiarCoolor1 = tocolor(255, 255, 255, 75) end end addEventHandler("onClientRender", root, cambiarColor) function cambiarColor1() if isCursorHover(x*0.6, y*0.47, x*0.2867, y*0.07) then cambiarCoolor2 = tocolor(255, 255, 255, 125) else cambiarCoolor2 = tocolor(255, 255, 255, 75) end end addEventHandler("onClientRender", root, cambiarColor1) function cambiarColor2() if isCursorHover(x*0.37, y*0.57,x*0.2, y*0.07) then cambiarCoolor3 = tocolor(255, 255, 255, 125) else cambiarCoolor3 = tocolor(255, 255, 255, 75) end end addEventHandler("onClientRender", root, cambiarColor2) function isCursorHover (x, y, width, height) if (not isCursorShowing ()) then return false end local sx, sy = guiGetScreenSize () local cx, cy = getCursorPosition () local cx, cy = (cx * sx), (cy*sy) if (cx >= x and cx <= x + width) and (cy >= y and cy <= y + height) then return true else return false end end
-
There's no error, as you can see I ask for help, for tell me how to make that when I click in the button "Sign In" all the dx elements move to down. Thanks.
-
Hey guys, im triying to make something like, a window (dx) that when the resource starts makes an animation from up to down, and when a player click in a button inside of it, it will animate to down, there is my code: local x, y = guiGetScreenSize() local px, py = 1920, 1080 local sx, sy = (x/py), (y/py) local start = getTickCount() local font = dxCreateFont("font.ttf", 52, false) function drawingLogin() local now = getTickCount() local elapsedTime = now - start local endTime = start + 1000 local duration = endTime - start local progress = elapsedTime / duration local x1, y1 = interpolateBetween(x/2-200, y/7, 0, x/2-200, y/3.5, 0, progress, "OutBounce") local x2, y2 = interpolateBetween(x/2+93, y/2-65, 0, x/2+93, y/2-33, 0, progress, "OutBounce") dxDrawImage(0, 0, x, y, "img/background.png") dxDrawRectangle(x1-450, y1+200, 400, 50, rectanglecchanger2) dxDrawRectangle(x1+400, y1+200, 400, 50, tocolor(255, 255, 255, 75)) dxDrawRectangle(x1, y1+200, 65, 50, tocolor(255, 255, 255, 75)) dxDrawRectangle(x1+285, y1+200, 65, 50, tocolor(255, 255, 255, 75)) dxDrawRectangle(x1, y1+275, 350, 50, rectanglecchanger1) dxDrawImage(x2, y2, 50, 50, "img/login.png") dxDrawImage(x2-285, y2, 50, 50, "img/register.png") dxDrawText("SIGN IN", x1-310, y1-320, x, y, tocolor(255, 255, 255, 255), 0.4, font, "left", "center", false, false, false, true, true) dxDrawText("ADD NEW ACCOUNT", x1+475, y1-320, x, y, tocolor(255, 255, 255, 255), 0.4, font, "left", "center", false, false, false, true, true) dxDrawText("PLAY AS GUEST", x1+107, y1-175, x, y, tocolor(255, 255, 255, 255), 0.3, font, "left", "center", false, false, false, true, true) showChat(false) showCursor(true) end addEventHandler("onClientRender", root, drawingLogin) function playAsGuest (button, state, absoluteX, absoluteY, wx, wy, wz, clickedElement) if state == "down" then if isMouseInPosition (x/2-200, y/2+43, 350, 50) then removeEventHandler("onClientRender", getRootElement(), drawingLogin) showChat(true) showCursor(false) end end end addEventHandler ("onClientClick", getRootElement(), playAsGuest) function changeToLogin (button, state, absoluteX, absoluteY, wx, wy, wz, clickedElement) local now = getTickCount() local elapsedTime = now - start local endTime = start + 1000 local duration = endTime - start local progress = elapsedTime / duration local x1, y1 = interpolateBetween(x/2-200, y/7, 0, x/2-200, y/3.5, 0, progress, "OutBounce") if state == "down" then if isMouseInPosition (x/2-650, y/2-31, 400, 50) then x1, y1 = interpolateBetween(x/2-200, y/3.5, 0, x/2-200, y/6, 0, progress, "OutBounce") end end end addEventHandler ("onClientClick", getRootElement(), changeToLogin) addEventHandler("onClientRender", root, drawingLogin) function cambiarColor1() if isMouseInPosition(x/2-200, y/2+43, 350, 50) then rectanglecchanger1 = tocolor(255, 255, 255, 50) else rectanglecchanger1 = tocolor(255, 255, 255, 125) end end addEventHandler("onClientRender", root, cambiarColor1) function cambiarColor2() if isMouseInPosition(x/2-650, y/2-31, 400, 50) then rectanglecchanger2 = tocolor(255, 255, 255, 50) else rectanglecchanger2 = tocolor(255, 255, 255, 125) end end addEventHandler("onClientRender", root, cambiarColor2) function isMouseInPosition (x, y, width, height) if (not isCursorShowing ()) then return false end local sx, sy = guiGetScreenSize () local cx, cy = getCursorPosition () local cx, cy = (cx * sx), (cy*sy) if (cx >= x and cx <= x + width) and (cy >= y and cy <= y + height) then return true else return false end end
-
Gracias y como puedo hacer para que cuando cree un rectangulo, y se haya animado por primera vez, cuando le de a un boton se vuelva a animar otra vez?
-
No encontré el video, y sigo sin saber como se hace ;(
-
Gracias, a ver si resuelve mi pregunta.
-
Es dx, y quiero que sea una animacion con interpolateBetween.
-
Estoy haciendo un login panel, y quería crear 4 archivos: -El principal donde se encuentran el acceso al panel de login y de registro. -El server para registrar a los jugadores. -El del panel de login para logear. -El del panel de register para registrar. Mi pregunta es: ¿cómo se puede hacer para que cuando en el archivo "main" le de click al boton de login, este desaparezca y salga el de login pero con una animacion de ambos? Gracias.
-
Well, what you want to do? If you want to hide the weapon hud everytime you have to: function hideWeaponHud() showPlayerHudComponentVisible("weapon", false) end addEventHandler("onResourceStart", root, hideWeaponHud)
-
local x, y, sx, sy = 1920, 1080 , 1920, 1080 local sourceWidth = 1980 local sourceHeight = 1080 local nSX, nSY, nWX, nHY = (x/sourceWidth), (y/sourceHeight), (sx/sourceWidth), (sy/sourceHeight) local start = getTickCount() local font = dxCreateFont("font.ttf", 52, false) function drawingLogin() --Animaciones local now = getTickCount() local elapsedTime = now - start local endTime = start + 1000 local duration = endTime - start local progress = elapsedTime / duration local x1, y1, z1 = interpolateBetween(x/2-200, y/7, 0, x/2-200, y/3.5, 0, progress, "OutBounce") local x2, y2, z2 = interpolateBetween(x/2+93, y/2-65, 0, x/2+93, y/2-33, 0, progress, "OutBounce") dxDrawImage(0, 0, x, y, "img/background.png") dxDrawRectangle(x1-450, y1+200, 400, 50, tocolor(255, 255, 255, 75)) dxDrawRectangle(x1+400, y1+200, 400, 50, tocolor(255, 255, 255, 75)) dxDrawRectangle(x1, y1+200, 65, 50, tocolor(255, 255, 255, 75)) dxDrawRectangle(x1+285, y1+200, 65, 50, tocolor(255, 255, 255, 75)) dxDrawRectangle(x1, y1+275, 350, 50, rectanglecchanger1) dxDrawImage(x2, y2, 50, 50, "img/login.png") dxDrawImage(x2-285, y2, 50, 50, "img/register.png") dxDrawText("SIGN IN", x1-310, y1-320, x, y, tocolor(255, 255, 255, 255), 0.4, font, "left", "center", false, false, false, true, true) dxDrawText("ADD NEW ACCOUNT", x1+475, y1-320, x, y, tocolor(255, 255, 255, 255), 0.4, font, "left", "center", false, false, false, true, true) dxDrawText("PLAY AS GUEST", x1+107, y1-175, x, y, tocolor(255, 255, 255, 255), 0.3, font, "left", "center", false, false, false, true, true) --Varios showChat(false) showCursor(true) end addEventHandler("onClientRender", root, drawingLogin) function playAsGuest (button, state, absoluteX, absoluteY, wx, wy, wz, clickedElement) if state == "down" then if isMouseInPosition (x/2-200, y/2+43, 350, 50) then removeEventHandler("onClientRender", root, drawingLogin) showChat(true) showCursor(false) end end end addEventHandler ("onClientClick", getRootElement(), playAsGuest) --Cambiar function cambiarColor1() if isMouseInPosition(x/2-200, y/2+43, 350, 50) then rectanglecchanger1 = tocolor(255, 255, 255, 50) else rectanglecchanger1 = tocolor(255, 255, 255, 125) end end addEventHandler("onClientRender", root, cambiarColor1) --Usefuls function isMouseInPosition (x, y, width, height) if (not isCursorShowing ()) then return false end local sx, sy = guiGetScreenSize () local cx, cy = getCursorPosition () local cx, cy = (cx * sx), (cy*sy) if (cx >= x and cx <= x + width) and (cy >= y and cy <= y + height) then return true else return false end end