Jump to content

AlvarO

Members
  • Posts

    119
  • Joined

  • Last visited

Everything posted by AlvarO

  1. Hey all, I was scripting a Login when a friend joined, told me that texts are showing up of the rectangles, but for me it is inside of them, please tell me whats wrong: local x, y = guiGetScreenSize() local px, py = 1980, 1080 local sx, sy = (x/px), (x/py) 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) 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) 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 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
  2. --To make the panel appear in the same postion on all resolutions local sx, sy = guiGetScreenSize() local px, py = 1980, 1080 --This is the scripter resolution, in my case mine is the one in left local x, y = (sx/py), (sy/py) --Animations --Using variables animation = 0 function animationsForDX() animation = animation + 1 dxDrawRectangle(x/2, y/2, animation, y, tocolor(0,0,0,200)) end addEventHandler("onClientRender", root, animationsForDX) --Or using interpolateBetween function animationsForDX() local x, y = interpolateBetween ( dx, dy, dx+4, dy+4, 1500, "Linear") dxDrawRectangle(x/2, y/2, dx, dy, tocolor(0,0,0,200)) end addEventHandler("onClientRender", root, animationsForDX) Hope I helped you!
  3. I didn't can you add me in skype for help? Please?
  4. Again the same debug, but instead of that warning, debug says: expected material at argument 5
  5. ERROR: va_scoreboard\client.lua:27: call: failed to call 'admin:getPlayerCountr'[string "?"] WARNING: va_scoreboard\client.lua:51: Bad argument @ 'dxDrawImage' [Expected vector2 at argument 1, got boolean]
  6. Hello guys, so I was making the scoreboard for the multigamemode of our clan and I had a problem with country flags: Code: local player = getLocalPlayer() local sx, sy = guiGetScreenSize() local px, py = 1360,768 local x, y = (sx/px), (sy/py) local fpsTick = getTickCount() local fps = 1 local players = getElementsByType( "player" ) function drawScoreboardGUI( ) local country = exports.admin:getPlayerCountry(source) local flag = country and ":admin/client/images/flags/"..country..".png" dxDrawRectangle(x*285, y*125, x*800, y*19, tocolor(50, 150, 210, 220), true) dxDrawRectangle(x*285, y*143, x*800, y*350, tocolor(0, 0, 0, 220), true) dxDrawRectangle(x*285, y*145, x*150, y*19, rectanglecchanger1, true) dxDrawRectangle(x*450, y*145, x*150, y*19, rectanglecchanger2, true) dxDrawRectangle(x*615, y*145, x*150, y*19, rectanglecchanger3, true) dxDrawRectangle(x*780, y*145, x*150, y*19, rectanglecchanger4, true) dxDrawRectangle(x*945, y*145, x*140, y*19, rectanglecchanger5, true) dxDrawText("Victorious Ace 1.0", x*520, y*(-55), x*852, y*326, tocolor(0, 0, 0, 255), x*2, "default-bold", "center", "center", false, false, true, false, false) dxDrawText("Deathmatch", x*(-125), y*(-15), x*852, y*326, tocolor(0, 0, 0, 255), x*1, "default-bold", "center", "center", false, false, true, false, false) dxDrawText("Destruction Derby", x*200, y*(-15), x*852, y*326, tocolor(0, 0, 0, 255), x*1, "default-bold", "center", "center", false, false, true, false, false) dxDrawText("Shooter", x*525, y*(-15), x*852, y*326, tocolor(0, 0, 0, 255), x*1, "default-bold", "center", "center", false, false, true, false, false) dxDrawText("Hunter", x*860, y*(-15), x*852, y*326, tocolor(0, 0, 0, 255), x*1, "default-bold", "center", "center", false, false, true, false, false) dxDrawText("Race", x*1175, y*(-15), x*852, y*326, tocolor(0, 0, 0, 255), x*1, "default-bold", "center", "center", false, false, true, false, false) for i, player in ipairs(getElementsByType("player")) do name = getPlayerName(player) dxDrawRectangle(x*285, y*170, x*800, y*19, tocolor(50, 150, 210, 220), true) --Nombre dxDrawText("Name", x*175, y*35, x*852, y*326, tocolor(0, 0, 0, 255), x*1, "default-bold", "center", "center", false, false, true, false, false) dxDrawRectangle(x*410, y*195, x*635, y*19, tocolor(175, 175, 175, 220), true) dxDrawText(name, x*175, y*85, x*852, y*326, tocolor(0, 0, 0, 255), x*1, "default-bold", "center", "center", false, false, true, true, false) --Pais dxDrawImage(flag, x * 0.4148, y * 0.2627, x * 0.0227, y * 0.0137, tocolor(213, 0, 0, 255), false) end for k,player in ipairs(getElementsByType("player")) do cuenta = k end dxDrawText("Players:"..cuenta.."/50", x*1130, y*(-55), x*852, y*326, tocolor(0, 0, 0, 255), x*1.5, "default-bold", "center", "center", false, false, true, false, false) end Debug: ERROR: va_scoreboard\client.lua:27: call: failed to call 'admin:getPlayerCountr'[string "?"] WARNING: va_scoreboard\client.lua:51: Bad argument @ 'dxDrawImage' [Expected vector2 at argument 1, got boolean]
  7. Ok thanks I already did it, thanks for the answer!
  8. Oh, thanks for the info! But now when I test it, edits dont appear ;v
  9. This is the full dxDrawing code: function drawLoginConcept() --Camera setCameraMatrix(358.822265625, -2066.345703125, 28.744483947754, 1500, 500, -850) --Dx --Variables: anim = 0 animacion = anim + 150 --Panel dxDrawRectangle(sX * 0.3570, sY * 0.2676, sX * 0.2867, sY * 0.4961, tocolor(0, 0, 0, login_alpha), false) dxDrawLine(sX * 0.3563, sY * 0.2617, sX * 0.3563, sY * 0.7627, tocolor(255, 60, 50, login_alpha), 2, false) dxDrawLine(sX * 0.3563, sY * 0.7637, sX * 0.6459, sY * 0.7637, tocolor(255, 60, 50, login_alpha), 2, false) dxDrawLine(sX * 0.6445, sY * 0.2607, sX * 0.6445, sY * 0.7630, tocolor(255, 60, 50, login_alpha), 2, false) dxDrawLine(sX * 0.3563, sY * 0.2617, sX * 0.6453, sY * 0.261, tocolor(255, 60, 50, login_alpha), 2, false) --Botones dxDrawRectangle (sX*0.375, sY*0.665, 150, 40,rectanglecchanger1, true) dxDrawRectangle (sX*0.51, sY*0.665, 150, 40, rectanglecchanger2, true) dxDrawRectangle (sX*0.375, sY*0.71, 323, 40, rectanglecchanger3, true) dxDrawRectangle (sX*0.356, sY*0.26, 370, 30, tocolor (255, 60, 50, 255), true) dxDrawRectangle(sX * 0.3575, sY * 0.6426, sX * 0.2859, sY * 0.0117, tocolor(255, 60, 50, 255), false) --Textos dxDrawText ("Register", sX*0.52, sY*0.60, sX/2-300/2+160+140, sY*0.73+40, tocolor (0, 0, 0, login_alpha), 2, "default-bold", "center", "center", false, false, true, true, false) dxDrawText ("Login", sX*0.25, sY*0.60, sX/2-300/2+160+140, sY*0.73+40, tocolor (0, 0, 0, login_alpha), 2, "default-bold", "center", "center", false, false, true, true, false) dxDrawText ("Play as guest", sX*0.385, sY*0.69, sX/2-300/2+160+140, sY*0.73+40, tocolor (0, 0, 0, login_alpha), 2, "default-bold", "center", "center", false, false, true, true, false) dxDrawText ("Login Panel", sX*0.385, sY*(-0.22), sX/2-300/2+160+140, sY*0.73+40, tocolor (0, 0, 0, login_alpha), 2, "default-bold", "center", "center", false, false, true, true, false) dxDrawText ("Username", sX*0.385, sY*(-0.11), sX/2-300/2+160+140, sY*0.73+40, tocolor (255, 60, 50, login_alpha), 2, "default-bold", "center", "center", false, false, true, true, false) dxDrawText ("Password", sX*0.385, sY*(0.111), sX/2-300/2+160+140, sY*0.73+40, tocolor (255, 60, 50, login_alpha), 2, "default-bold", "center", "center", false, false, true, true, false) --Edits boxes and checkbox userBox = guiCreateEdit(476, 361, 334, 29, "", true) passBox = guiCreateEdit(476, 479, 334, 29, "", true) guiEditSetMasked(passBox, true) guiSetEnabled(userBox,true) guiSetEnabled(passBox,true) --Varios showChat(true) showCursor(true) end addEventHandler("onClientRender", root, drawLoginConcept) addEventHandler("onClientResourceStart", resourceRoot, drawLoginConcept)
  10. I can't write on it and my code dosnt have the thing you said
  11. But im not making it GUI, I have a dx panel with all created, buttons and whatever (buttons are dx), but when I create the edit and I want to write inside them I can't
  12. Hello guys, today I was making a login panel to my clan but I got a problem that when I want to write inside of the edit, it dosn't work and I don't know what to do, the code is the following one: userBox = guiCreateEdit(476, 361, 334, 29, "", false) Whats bad with that? Can you explain me it pls? Thanks you guys so much
  13. Then how it will looks like? The script I mean
  14. No, see, I want the missile looking out to where the screen, for example the car is looking at a building and I'm looking to the right, so I want that the missile will be launched to the right.
  15. Is the same, make the same function but what I want is launch the rocket where the camera is looking. I don't know but I think I've to use: setCameraMatrix
  16. Hello guys, yesterday i was creating a script, a car who launch rockets, but i got a question... How can I put for that when you launch a rocket (for example a grenade) it goes for where you are looking with the screen? I dont know if I explained good because my english is a pretty shit. There you have the code: function shootProjectile() local vehicle = getPedOccupiedVehicle(localPlayer) if(vehicle)then local x, y, z = getElementPosition(vehicle) createProjectile(vehicle, 19, x, y, z) else outputChatBox("No estas dentro de un vehiculo",255, 0, 0) end end bindKey("k", "down", shootProjectile)
×
×
  • Create New...