Jump to content

AlvarO

Members
  • Posts

    123
  • Joined

  • Last visited

Everything posted by AlvarO

  1. AlvarO

    Down arrow bug

    Okay, thanks you, it worked!
  2. AlvarO

    Down arrow bug

    https://gyazo.com/38670ec19a7827ab1acf45f6df5dfc34
  3. AlvarO

    Down arrow bug

    https://pastebin.mtasa.com/521315522
  4. AlvarO

    Down arrow bug

    First of all, I never had a bug like this so its a bit strange, I've talked with many players of mta and nobody of them had this error/bug before. So the bug is that when im playing, it looks like im holding always the down arrow, but im not holding it and I don't know how to fix it, already changed from my new keyboard to other one and the bug is still appearing, it is a cumbersome to have a small playtime and you can't play in any MTA server, hope you guys help me with this.
  5. It's easy, just use (valueinrelative/yourXsize)*screenW, (valueinrelative/yourYsize)* screenH , (valueinrelative/yourXsize)*screenW, (valueinrelative/yourYsize)* screenH Little example: [lua] local sX, sY = guiGetScreenSize() dxDrawImage((25/1920)*sX, (192/1080)*sY, (10/1920)*sX, (193/1080)*sY, "hello.png", 0, 0, 0, tocolor(255, 255, 255, 255, false) [/lua] Also don't forget to use "onClientRender"
  6. Thanks again tails, but I though about some loops, tables and draws, and i made one from 0, and it works correctly, thanks for your help man!
  7. I still need a bit of help, i checked if the mouse is on the categorie rectangle, and then i checked if the key pressed is mouse1 (the left button of mouse), but still don't know how to continue, im newbie in this of making/editing dxGUIs CODE: hover = false addEventHandler ( "onClientRender", root, function ( ) -- Is there any gridlist to render? if #dxGrid.items > 0 then -- Loop through all grid lists for index, data in ipairs ( dxGrid.items ) do -- Is the gridlist visible? if data.vis then -- Draw the 'gridlist' itself dxDrawRectangle ( data.x, data.y, data.w, 30 % data.h, tocolor ( 255, 102, 0, 220 ), true ); -- Set cursorOn variable to the current gridlist, if it's selected cursorOn = nil if __isMouseInPosition ( data.x, data.y, data.w, data.h ) then cursorOn = index; end -- Check if there's any selected item local seeFrom = data.s; local seeTo = ( data.s + data.mi ) - 1; if data.se and data.se <= data.r and data.se >= seeFrom and data.se <= seeTo then local index = data.se - ( data.s - 1 ); local y2 = data.y + ( ( index - 1 ) * 25 ); -- Draw a rectangle to make it looks like selected dxDrawRectangle ( data.x, ( 30 % data.h ) + y2, data.w, 20, tocolor ( 0, 0, 0, 100 ), data.pg ); end -- Is there any column? if #data.i > 0 then local cWidth = 0 -- Loop through all columns for cIndex, cData in ipairs ( data.i ) do -- we'll go beyond the gridlist width with this column ? if ( ( cWidth + cData.info.width ) <= data.w ) then local x = data.x + cWidth; -- Draw the column title dxDrawText ( cData.info.title, x, data.y, cData.info.width + x, ( 30 % data.h ) + data.y, tocolor ( 255, 255, 255 ), FIT_MODE and ( 1 * SCALE ) or 1, "default-bold", "center", "center", true, true, true, false, true ); -- Reset the selected item cData.info.selected = -1; -- Is there any item ? if __isMouseInPosition(data.x, data.y, data.w, data.h) then if getKeyState("mouse1") then hover = true if #cData > 0 and hover == true then local seeFrom = data.s; local seeTo = ( data.s + data.mi ) - 1; -- Loop the items for iIndex = seeFrom, seeTo do -- There's a row with this index in the current column? if cData[iIndex] then local index = iIndex - ( data.s - 1 ); local y = data.y + ( index * 25 ); local y2 = data.y + ( ( index - 1 ) * 25 ); -- Check if cursor is on item position if __isMouseInPosition ( data.x, ( 30 % data.h ) + y2, data.w, 20 ) then -- Define the mouse-on variable data.mo = iIndex; end -- Draw the item text dxDrawText ( cData[iIndex]["text"], x, y, cData.info.width + x, ( 30 % data.h ) + y, tocolor ( unpack ( cData[iIndex]["color"] ) ), FIT_MODE and ( 1 * SCALE ) or 1, "default-bold", "center", "center", true, true, data.pg, false, true ); dxDrawRectangle ( data.x, data.y, data.w, data.h, tocolor ( 0, 0, 0, 200 ), data.pg ); end end end -- Increase cWidth variable (to draw the columns correctly) cWidth = cWidth + cData.info.width; end end end end end end end end end , true, "low-5")
  8. Okay tails, thanks for your help, I'll try to script it now, very useful reply thanks.
  9. Someone could help me? I'm still trying to make this, but no idea how
  10. --With that true you enable colorCoding so you can write for example #adff2f in brackets where do you want the text get colorized outputChatBox("[HOUR]: "..hours..":".."minutes", 255, 0, 255, true)
  11. Hey guys, I'm trying to edit a dxGridlist whose owner is t3wz, all rights goes for he. So I tried to make that for when the cursor clicks on the colum, it will show the items, and when one item is selected, the list of items will get closed, but I don't know how to make it, so if someone more experimented could help me I would be glad of it, the code is the following: dxGrid = { items = {} }; local cursorOn; local shown = false local NATIVE_RESOLUTION = { 1920, 1080 } if ( table.maxn ( NATIVE_RESOLUTION ) == 2 ) then FIT_MODE = true RES = { guiGetScreenSize() }; X,Y = RES[1] / NATIVE_RESOLUTION[1], RES[2] / NATIVE_RESOLUTION[2]; SCALE = ( 1 / NATIVE_RESOLUTION[1] ) * RES[1]; end --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Core - functions function dxGrid:Create ( x, y, width, height, postGUI ) if __checkParams ( "Create", "nnnn", x, y, width, height ) then local data = { x = FIT_MODE and ( x * X ) or x; -- X position y = FIT_MODE and ( y * Y ) or y; -- Y position w = FIT_MODE and ( width * X ) or width; -- Width h = FIT_MODE and ( height * Y ) or height; -- Height pg = postGUI or false; -- PostGUI i = {}; -- Items mi = __calcMaxItems ( FIT_MODE and ( height * Y ) or height ); -- Max items s = 1; -- Scroll Level r = -1; -- Row count se = -1; -- Selected item mo = nil; -- Mouse-on item vis = true -- Visible }; setmetatable ( data, { __index = dxGrid } ); table.insert ( dxGrid.items, data ) return data; end end function dxGrid:Destroy () -- bool dxGrid:Destroy () for k, v in pairs ( dxGrid.items ) do if v == self then dxGrid.items[k] = nil; return true; end end return false; end function dxGrid:SetVisible ( visible ) -- bool Gridlist:SetVisible ( bool state ) if __checkParams ( "SetVisible", "b", visible ) then self.vis = visible return true else return false end end function dxGrid:IsVisible ( ) -- bool Gridlist:IsVisible() return self.vis end function dxGrid:AddColumn ( title, width ) -- int Gridlist:AddColumn ( string title, int width ) if __checkParams ( "AddColumn", "sn", title, width ) then local data = { info = { title = title, width = FIT_MODE and ( width * X ) or width } }; table.insert ( self.i, data ); return #self.i; end end function dxGrid:RemoveColumn ( columnIndex ) -- bool Gridlist:RemoveColumn ( int columnIndex ) if __checkParams ( "RemoveColumn", "n", columnIndex ) then self.i[columnIndex] = nil; -- Recalculate the highest item count local highest = -1; for _, v in ipairs ( self.i ) do if #v > highest then highest = ( #v - 1 ); end end self.r = highest; -- Recalculate the scroll level (if necessary) if ( ( ( self.s + self.mi ) - 2 ) == self.r ) then self.s = ( self.r - self.mi ) + 1; end return true end return false end function dxGrid:GetColumnCount () -- int Gridlist:GetColumnCount() return #self.i end function dxGrid:AddItem ( columnIndex, text, data, r, g, b ) -- int Gridlist:AddItem ( int columnIndex, string title[, mixed data, int r, int g, int b ] ) if __checkParams ( "AddItem", "ns", columnIndex, text ) then if self.i[columnIndex] then local tColor = __checkRGB ( r, g, b ) and { r, g, b } or { 255, 255, 255 }; table.insert ( self.i[columnIndex], { id = #self.i[columnIndex] + 1, text = tostring( text ), data = data, color = tColor } ); if #self.i[columnIndex] > self.r then self.r = #self.i[columnIndex]; end return #self.i[columnIndex]; end return false; end end function dxGrid:RemoveItem ( column, itemID ) -- bool Gridlist:RemoveItem ( int columnIndex, int itemIndex ) if __checkParams ( "RemoveItem", "nn", column, itemID ) then if self.i[column] and self.i[column][itemID] then -- Recalculate the highest item count if self.r == #self.i[column] then local highest = -1; for _, v in ipairs ( self.i ) do if #v > highest then highest = ( #v - 1 ); end end self.r = highest; end -- Recalculate the scroll level (if necessary) if ( ( ( self.s + self.mi ) - 2 ) == self.r ) then self.s = ( self.r - self.mi ) + 1; end -- Reset the selected item if necessary² if itemID == self.se then local newItem = self.se - 1 if newItem <= self.r then self.se = math.max ( 0, newItem ); else self.se = -1 end end table.remove ( self.i[column], itemID ); return true; end return false end end function dxGrid:GetItemCount ( columnID ) -- int Gridlist:GetItemCount ( int columnIndex ) if __checkParams ( "GetItemCount", "n", columnID ) then if self.i[columnID] then return #self.i[columnID] end return false end end function dxGrid:Clear () -- bool Gridlist:Clear() for k, v in ipairs ( self.i ) do self.i[k] = { info = v.info } end self.r = -1 self.se = nil -- Recalculate the scroll level self.s = 1; return true end function dxGrid:GetSelectedItem ( ) -- int Gridlist:GetSelectedItem () return self.se; end function dxGrid:SetSelectedItem ( itemID ) -- bool Gridlist:SetSelectedItem ( int itemIndex ) if __checkParams ( "SetSelectedItem", "n", itemID ) then if itemID <= self.r then self.se = itemID; return self.se == itemID; end return false; end end function dxGrid:GetItemDetails ( column, itemID ) -- string, mixed Gridlist:GetItemDetails ( int columnIndex, int itemIndex ) if __checkParams ( "GetItemDetails", "nn", columnID, itemID ) then if self.i[column] then if self.i[column][itemID] then return self.i[column][itemID].text, self.i[column][itemID].data end end return false end end --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Core - render/move function drawDxGridlist( button, state, absoluteX, absoluteY, wx, wy, wz, clickedElement ) -- Is there any gridlist to render? if #dxGrid.items > 0 then -- Loop through all grid lists for index, data in ipairs ( dxGrid.items ) do -- Is the gridlist visible? if data.vis then -- Draw the 'gridlist' itself dxDrawRectangle ( data.x, data.y, data.w, data.h, tocolor ( 0, 0, 0, 200 ), data.pg ); -- Draw the column bar dxDrawRectangle ( data.x, data.y, data.w, 30 % data.h, tocolor ( 0, 0, 0, 220 ), data.pg ); -- Set cursorOn variable to the current gridlist, if it's selected cursorOn =
  12. I tried it, but it happens again, when i start the script it shows, but what i tried to do is when I start the script, it hides since i press a key, sorry for my english.
  13. I got a problem, I don't know which event wrote with the function where I script the gridlist, when i add no event, it dosn't shows and when I add it, it shows everytime, I added gridlist:SetVisible ( false ) but still when I start the script It shows, any help? function categorias() gridlist = dxGrid:Create ( (780/1920)*sX, (250/1080)*sY, (125/1920)*sX, (100/1080)*sY); gridlist:AddColumn ( "Gamemode", (125/1920)*sX ); for i = 1, 3 do gridlist:AddItem ( 1, categories[i] ) end end addEventHandler("onResourceStart", root, categorias)
  14. I didn't understand that, but i though you told me to use onClientRender event handler instead of the function name, isn't it right? By the way, I obtained this error: ERROR: dashboard\core.lua:71: attempt to call global 'openPage' (a nil value)
  15. There are different pages, i'll post them all: --Core page local dxfont_0 = dxCreateFont("font/font.ttf", 16) local dxfont_1 = dxCreateFont("font/font.ttf", 12) local visible = false local sX, sY = guiGetScreenSize() local playerMoney = getPlayerMoney(localPlayer) or 0 local state = "homepage" local alpha = 0 function drawCore() dxDrawRectangle((383/1366)*sX, (150/768)*sY, (600/1366)*sX, (450/768)*sY, tocolor(0, 0, 0, 150), false) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ name = getPlayerName(localPlayer) dxDrawText(name, x*320, y*(pos+height-45), x*505, y*326, tocolor(255, 255, 255, 255), x*0.9, "default-bold", "left", "center", false, false, true, true, false) dxDrawImage( (400/1366)*sX, (160/768)*sY, (50/1366)*sX, (50/768)*sY, "img/profile.png", 0, 0, 0 ) dxDrawText(name, (490/1366)*sX, (167/768)*sY, (505/1366)*sX, (326/768)*sY, tocolor(255, 255, 255, 255), sX*0.9, dxfont_0, "left", "center", false, false, true, true, false) dxDrawText ("Money: "..playerMoney.."$", (458/1366)*sX, (180/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), 1, dxfont_0) ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ if isMouseInPosition ((395/1366)*sX, (230/768)*sY, (160/1366)*sX, (35/768)*sY) then dxDrawRectangle((395/1366)*sX, (230/768)*sY, (160/1366)*sX, (35/768)*sY, tocolor(255, 102, 0, 25)) end dxDrawImage((400/1366)*sX, (233/768)*sY, (25/1366)*sX, (25/768)*sY, "img/home.png", 0, 0, 0 ) dxDrawText ("Home", (460/1366)*sX, (245/768)*sY, x, y, tocolor ( 255, 102, 0, 255 ), 1, dxfont_0, "center", "center", false, false, true, true, false) if isMouseInPosition ((395/1366)*sX, (280/768)*sY, (160/1366)*sX, (35/768)*sY) then dxDrawRectangle((395/1366)*sX, (280/768)*sY, (160/1366)*sX, (35/768)*sY, tocolor(255, 102, 0, 25)) end dxDrawImage( (400/1366)*sX, (283/768)*sY, (25/1366)*sX, (25/768)*sY, "img/pie-chart.png", 0, 0, 0 ) dxDrawText ("Personal Stats", (487/1366)*sX, (295/768)*sY, x, y, tocolor ( 240, 120, 90, 255 ), (0.9/1366)*sX, dxfont_0, "center", "center", false, false, true, true, false) if isMouseInPosition ((395/1366)*sX, (330/768)*sY, (160/1366)*sX, (35/768)*sY) then dxDrawRectangle((395/1366)*sX, (330/768)*sY, (160/1366)*sX, (35/768)*sY, tocolor(255, 102, 0, 25)) end dxDrawImage( (400/1366)*sX, (333/768)*sY, (25/1366)*sX, (25/768)*sY, "img/trophy.png", 0, 0, 0 ) dxDrawText ("Achievements", (487/1366)*sX, (345/768)*sY, x, y, tocolor ( 248, 216, 93, 255 ), (0.9/1366)*sX, dxfont_0, "center", "center", false, false, true, true, false) if isMouseInPosition ((395/1366)*sX, (380/768)*sY, (160/1366)*sX, (35/768)*sY) then dxDrawRectangle((395/1366)*sX, (380/768)*sY, (160/1366)*sX, (35/768)*sY, tocolor(255, 102, 0, 25)) end dxDrawImage( (400/1366)*sX, (383/768)*sY, (25/1366)*sX, (25/768)*sY, "img/graph.png", 0, 0, 0 ) dxDrawText ("Leaderboard", (487/1366)*sX, (395/768)*sY, x, y, tocolor ( 240, 155, 34, 255 ), (0.9/1366)*sX, dxfont_0, "center", "center", false, false, true, true, false) if isMouseInPosition ((395/1366)*sX, (430/768)*sY, (160/1366)*sX, (35/768)*sY) then dxDrawRectangle((395/1366)*sX, (430/768)*sY, (160/1366)*sX, (35/768)*sY, tocolor(255, 102, 0, 25)) end dxDrawImage( (400/1366)*sX, (433/768)*sY, (25/1366)*sX, (25/768)*sY, "img/map.png", 0, 0, 0 ) dxDrawText ("Mapshop", (487/1366)*sX, (445/768)*sY, x, y, tocolor ( 157, 167, 207, 255 ), 1, dxfont_0, "center", "center", false, false, true, true, false) if isMouseInPosition ((395/1366)*sX, (480/768)*sY, (160/1366)*sX, (35/768)*sY) then dxDrawRectangle((395/1366)*sX, (480/768)*sY, (160/1366)*sX, (35/768)*sY, tocolor(255, 102, 0, 25)) end dxDrawImage( (400/1366)*sX, (483/768)*sY, (25/1366)*sX, (25/768)*sY, "img/car.png", 0, 0, 0 ) dxDrawText ("Car customization", (487/1366)*sX, (495/768)*sY, x, y, tocolor ( 182, 212, 237, 255 ), (0.75/1366)*sX, dxfont_0, "center", "center", false, false, true, true, false) if isMouseInPosition ((395/1366)*sX, (530/768)*sY, (160/1366)*sX, (35/768)*sY) then dxDrawRectangle((395/1366)*sX, (530/768)*sY, (160/1366)*sX, (35/768)*sY, tocolor(255, 102, 0, 25)) end dxDrawImage( (400/1366)*sX, (533/768)*sY, (25/1366)*sX, (25/768)*sY, "img/settings.png", 0, 0, 0 ) dxDrawText ("Settings", (487/1366)*sX, (545/768)*sY, x, y, tocolor ( 68, 68, 68, 255 ), 1, dxfont_0, "center", "center", false, false, true, true, false) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- showPage("homepage") end function joinPersonalStats (button, state, absoluteX, absoluteY, wx, wy, wz, clickedElement) if state == "down" then if isMouseInPosition ((395/1366)*sX, (280/768)*sY, (160/1366)*sX, (35/768)*sY) then openPage("personalStats") end end end addEventHandler ("onClientClick", getRootElement(), joinPersonalStats) bindKey("u", "down", function() if visible == true then visible = false removeEventHandler("onClientRender", getRootElement(), drawCore) showCursor(false) else visible = true addEventHandler("onClientRender", getRootElement(), drawCore) showCursor(true) end end ) 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 addEventHandler('onClientPlayerJoin', root, function() outputChatBox('[JOIN] #FFFFFF' .. getPlayerName(source) .. '#FFFFFF has joined the game.', 255, 102, 0,true) end ) addEventHandler('onClientPlayerChangeNick', root, function(oldNick, newNick) outputChatBox('[NICK] #FFFFFF' .. oldNick .. ' #FFFFFFis now known as #FFFFFF' .. newNick, 255, 102, 0,true) end ) addEventHandler('onClientPlayerQuit', root, function(reason) outputChatBox('[QUIT] #FFFFFF' .. getPlayerName(source) .. ' #FFFFFFhas left the game #FF6600[' .. reason .. '].', 255, 102, 0,true) end ) --Homepage local sX, sY = guiGetScreenSize() local dxfont_0 = dxCreateFont("font/font.ttf", 16) local dxfont_1 = dxCreateFont("font/font.ttf", 12) function openHomepage() -- 200 = interpolateBetween( 255, 0, 0, 0, 0, 0, 1500, "Linear" ) dxDrawImage( (880/1366)*sX, (160/768)*sY, (25/1366)*sX, (25/768)*sY, "img/home.png", 0, 0, 0, tocolor(255, 255, 255, 255) ) dxDrawText ("Home", (915/1366)*sX, (158/768)*sY, x, y, tocolor ( 255, 102, 0, 255 ), 1, dxfont_0) dxDrawImage( (560/1366)*sX, (235/768)*sY, (375/1366)*sX, (115/768)*sY, "img/header.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawEmptyRec((560/1366)*sX, (235/768)*sY, (375/1366)*sX, (115/768)*sY, tocolor(255, 102, 0, 200), 1, false) dxDrawRectangle((560/1366)*sX, (315/768)*sY, (375/1366)*sX, (35/768)*sY, tocolor(255, 102, 0, 200), false) dxDrawText ("NEWS: Read our latest news in our website [url=http://www.shc-clan.com]www.shc-clan.com[/url]!, (565/1366)*sX, (320/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0) ---------------------------------------------------------------------------------------------------------------------------------------------------------------- dxDrawEmptyRec((560/1366)*sX, (375/768)*sY, (165/1366)*sX, (175/768)*sY, tocolor(255, 102, 0, 200), 1, false) dxDrawText ("Latest clanwars", (595/1366)*sX, (380/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0) dxDrawText ("SHC 14 - 6 xS//", (595/1366)*sX, (400/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0) dxDrawText ("SHC 15 - 5 eo3//", (595/1366)*sX, (420/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0) dxDrawText ("SHC 13 - 7 iR|", (595/1366)*sX, (440/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0) dxDrawText ("SHC 9 - 11 xN#", (595/1366)*sX, (460/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0) dxDrawText ("SHC 16 - 4 [GoD]", (595/1366)*sX, (480/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0) dxDrawText ("SHC 10 - 11 |6s", (595/1366)*sX, (500/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0) dxDrawText ("Visit our website for more", (570/1366)*sX, (530/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (0.7/1366)*sX, dxfont_0) ---------------------------------------------------------------------------------------------------------------------------------------------------------------- if isMouseInPosition ((740/1366)*sX, (375/768)*sY, (90/1366)*sX, (115/768)*sY) then dxDrawRectangle((740/1366)*sX, (375/768)*sY, (90/1366)*sX, (115/768)*sY, tocolor(150, 150, 150, 75)) end dxDrawEmptyRec((740/1366)*sX, (375/768)*sY, (90/1366)*sX, (115/768)*sY, tocolor(255, 102, 0, 200), 1, false) dxDrawImage( (760/1366)*sX, (415/768)*sY, (50/1366)*sX, (50/768)*sY, "img/notebook.png", 0, 0, 0, tocolor(255, 255, 255, 255)) if isMouseInPosition ((845/1366)*sX, (375/768)*sY, (90/1366)*sX, (115/768)*sY) then dxDrawRectangle((845/1366)*sX, (375/768)*sY, (90/1366)*sX, (115/768)*sY, tocolor(150, 150, 150, 75)) end dxDrawEmptyRec((845/1366)*sX, (375/768)*sY, (90/1366)*sX, (115/768)*sY, tocolor(255, 102, 0, 200), 1, false) dxDrawImage( (865/1366)*sX, (415/768)*sY, (50/1366)*sX, (50/768)*sY, "img/team.png", 0, 0, 0, tocolor(255, 255, 255, 255) ) ---------------------------------------------------------------------------------------------------------------------------------------------------------------- dxDrawEmptyRec((740/1366)*sX, (495/768)*sY, (195/1366)*sX, (55/768)*sY, tocolor(255, 102, 0, 200), 1, false) dxDrawText ("www.shc-clan.com", (763/1366)*sX, (510/768)*sY, x, y, tocolor ( 255, 255, 255, 255 ), (1/1366)*sX, dxfont_0) end function closeHomepage() removeEventHandler("onClientRender", getRootElement(), openHomepage) end function dxDrawEmptyRec(startX, startY, endX, endY, color, width, postGUI) dxDrawLine ( startX, startY, startX+endX, startY, color, width, postGUI ) dxDrawLine ( startX, startY, startX, startY+endY, color, width, postGUI ) dxDrawLine ( startX, startY+endY, startX+endX, startY+endY, color, width, postGUI ) dxDrawLine ( startX+endX, startY, startX+endX, startY+endY, color, width, postGUI ) end --Personal stats page local sX, sY = guiGetScreenSize() local dxfont_0 = dxCreateFont("font/font.ttf", 16) local dxfont_1 = dxCreateFont("font/font.ttf", 12) function openPersonalStats() dxDrawRectangle((560/1366)*sX, (315/768)*sY, (375/1366)*sX, (35/768)*sY, tocolor(255, 102, 0, 200), false) dxDrawText ("Personal stats:", (565/1366)*sX, (320/768)*sY, x, y, tocolor ( 255, 255, 255, 200 ), (0.7/1366)*sX, dxfont_0) end function closePersonalStats() removeEventHandler("onClientRender", getRootElement(), openPersonalStats) end And the other file is the one i posted before. Thanks guys for you help
  16. I was scripting and tried to make a dashboard, the design is done etc.. but when I tried to make different pages and make them changing when a player clicks in a button, it dosn't changes, I hope I explained myself, my english is not so good. --I tried this: function showPage(thePage) if thePage == "homepage" then openHomepage() closePersonalStats() elseif thePage == "personalStats" then openPersonalStats() closeHomepage() end end
  17. Hey guys I was doing a radio script and when I tried to get the radio song and the guy who is streaming used dxGetTextWidth for make it sizable with a rectangle, but I dont know how to make it function drawing() if sound then if (working) then local ls,rs = getSoundLevelData(sound); if (ls ~= false) then if moveOn == true then local meta = getSoundMetaTags(sound); local title = meta.title or "Unknown" local name = meta.stream_name or "Unknown" local longitud = dxGetTextWidth ( title, 1.25, myFont, true ) local longitud2 = dxGetTextWidth (" || Played by: "..name, 1.25, myFont, true ) --Marco dxDrawRectangle(x*1630, y*70, -longitud-longitud2-15, y*30, tocolor(255, 136, 0, 255), false) --Soundwave dxDrawRectangle(x*1625, y*100, x*5, (x*(-30))*(ls/32768), tocolor(0, 0, 0, 255), true) if title then dxDrawText(title.." || Played by: "..name, x*longitud+longitud2, y*(-153), x*852, y*326, tocolor(0, 0, 0, 255), 1.25, myFont, "center", "center", true, true, true, true, true) else title = "Song can't be found sorry." end end end end end end addEventHandler("onClientRender", root, drawing)
  18. setCameraTarget(localPlayer,localPlayer) Try that instead of player.
  19. Any way? I tried it but i don't know how to do it
  20. Any way? I tried it but i don't know how to do it
  21. Check the variables and take a look using 5000. lookAtX: The x coordinate of the point the camera faces. lookAtY: The y coordinate of the point the camera faces. lookAtZ: The z coordinate of the point the camera faces. roll: The camera roll angle, -180 to 180. A value of 0 means the camera sits straight, positive values will turn it counter-clockwise and negative values will turn it clockwise. -180 or 180 means the camera is upside down. fov: the field of view angle, 0 to 180. The higher this value is, the more you will be able to see what is to your sides.
×
×
  • Create New...