Jump to content

Turbesz

Members
  • Posts

    245
  • Joined

  • Last visited

Everything posted by Turbesz

  1. Doesn't working local displayWidth, displayHeight = guiGetScreenSize(); local notificationData = {}; local notificationFont = dxCreateFont('files/fonts/roboto.ttf', 12 * 2, false); local iconsFont = dxCreateFont('files/fonts/icons.ttf', 12 * 2, false); addEventHandler('onClientRender', root, function() for k, v in pairs(notificationData) do if (v.State == 'fadeIn') then local alphaProgress = (getTickCount() - v.AlphaTick) / 650; local alphaAnimation = interpolateBetween(0, 0, 0, 255, 0, 0, alphaProgress, 'Linear'); if (alphaAnimation) then v.Alpha = alphaAnimation; else v.Alpha = 255; end if (alphaProgress > 1) then v.Tick = getTickCount(); v.State = 'openTile'; end elseif (v.State == 'fadeOut') then local alphaProgress = (getTickCount() - v.AlphaTick) / 650; local alphaAnimation = interpolateBetween(255, 0, 0, 0, 0, 0, alphaProgress, 'Linear'); if (alphaAnimation) then v.Alpha = alphaAnimation; else v.Alpha = 0; end if (alphaProgress > 1) then notificationData = {}; end elseif (v.State == 'openTile') then local tileProgress = (getTickCount() - v.Tick) / 350; local tilePosition = interpolateBetween(v.StartX, 0, 0, v.EndX, 0, 0, tileProgress, 'Linear'); local tileWidth = interpolateBetween(0, 0, 0, v.Width, 0, 0, tileProgress, 'Linear'); if (tilePosition and tileWidth) then v.CurrentX = tilePosition; v.CurrentWidth = tileWidth; else v.CurrentX = v.EndX; v.CurrentWidth = v.Width; end if (tileProgress > 1) then v.State = 'fixTile'; setTimer(function() v.Tick = getTickCount(); v.State = 'closeTile'; end, string.len(v.Text) * 45 + 5000, 1); end elseif (v.State == 'closeTile') then local tileProgress = (getTickCount() - v.Tick) / 350; local tilePosition = interpolateBetween(v.EndX, 0, 0, v.StartX, 0, 0, tileProgress, 'Linear'); local tileWidth = interpolateBetween(v.Width, 0, 0, 0, 0, 0, tileProgress, 'Linear'); if (tilePosition and tileWidth) then v.CurrentX = tilePosition; v.CurrentWidth = tileWidth; else v.CurrentX = v.StartX; v.CurrentWidth = 0; end if (tileProgress > 1) then v.AlphaTick = getTickCount(); v.State = 'fadeOut'; end elseif (v.State == 'fixTile') then v.Alpha = 255; v.CurrentX = v.EndX; v.CurrentWidth = v.Width; end roundedRectangle(v.CurrentX, 20, 25 + v.CurrentWidth, 25, tocolor(0, 0, 0, 150 * 255 / 255), _, true); dxDrawRectangle(v.CurrentX, 20, 25, 25, tocolor(0, 0, 0, 255 * 255 / 255), true); if (v.Alpha == 255) then dxDrawText(v.Text, v.CurrentX + 25 + 10, 20, v.CurrentX + 25 + 10 + v.CurrentWidth - 20, 20 + 25, tocolor(255, 255, 255, 255), 0.40, notificationFont, 'center', 'center', true, false, true); end if (v.Type == 'error') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(215, 90, 90, 255), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'warning') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(220, 180, 80, 255), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'info') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(85, 180, 245, 255), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'success') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(80, 205, 105, 255), 0.50, iconsFont, 'center', 'center', false, false, true); end end end ) addEvent('addNotification', true); function addNotification(text, type) if (text and type) then if (notificationData ~= nil) then table.remove(notificationData, #notificationData); end table.insert(notificationData, { StartX = (displayWidth / 2) - (25 / 2), EndX = (displayWidth / 2) - ((dxGetTextWidth(text, 0.40, notificationFont) + 20 + 25) / 2), Text = text, Width = dxGetTextWidth(text, 0.40, notificationFont) + 20, Alpha = 0, State = 'fadeIn', Tick = 0, AlphaTick = getTickCount(), CurrentX = (displayWidth / 2) - (25 / 2), CurrentWidth = 0, Type = type or 'info' } ); if (fileExists('files/sounds/' .. type .. '.mp3')) then if (notificationData.soundEffect and isElement(notificationData.soundEffect)) then destroyElement(notificationData.soundEffect); end notificationData.soundEffect = playSound('files/sounds/' .. type .. '.mp3', false); else playSoundFrontEnd(11); end end end addEventHandler('addNotification', root, addNotification); function roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI) if (x and y and w and h) then if (not borderColor) then borderColor = tocolor(0, 0, 0, 200); end if (not bgColor) then bgColor = borderColor; end --> Background dxDrawRectangle(x, y, w, h, bgColor, postGUI); --> Border dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI); -- top dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI); -- bottom dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI); -- left dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI); -- right end end
  2. no errors, but doesn't working --client local displayWidth, displayHeight = guiGetScreenSize(); local notificationData = {}; local notificationFont = dxCreateFont('files/fonts/roboto.ttf', 12 * 2, false); local iconsFont = dxCreateFont('files/fonts/icons.ttf', 12 * 2, false); addEventHandler('onClientRender', root, function() for k, v in pairs(notificationData) do if (v.State == 'fadeIn') then local alphaProgress = (getTickCount() - v.AlphaTick) / 650; local alphaAnimation = interpolateBetween(0, 0, 0, 255, 0, 0, alphaProgress, 'Linear'); if (alphaAnimation) then v.Alpha = alphaAnimation; else v.Alpha = 255; end if (alphaProgress > 1) then v.Tick = getTickCount(); v.State = 'openTile'; end elseif (v.State == 'fadeOut') then local alphaProgress = (getTickCount() - v.AlphaTick) / 650; local alphaAnimation = interpolateBetween(255, 0, 0, 0, 0, 0, alphaProgress, 'Linear'); if (alphaAnimation) then v.Alpha = alphaAnimation; else v.Alpha = 0; end if (alphaProgress > 1) then notificationData = {}; end elseif (v.State == 'openTile') then local tileProgress = (getTickCount() - v.Tick) / 350; local tilePosition = interpolateBetween(v.StartX, 0, 0, v.EndX, 0, 0, tileProgress, 'Linear'); local tileWidth = interpolateBetween(0, 0, 0, v.Width, 0, 0, tileProgress, 'Linear'); if (tilePosition and tileWidth) then v.CurrentX = tilePosition; v.CurrentWidth = tileWidth; else v.CurrentX = v.EndX; v.CurrentWidth = v.Width; end if (tileProgress > 1) then v.State = 'fixTile'; setTimer(function() v.Tick = getTickCount(); v.State = 'closeTile'; end, string.len(v.Text) * 45 + 5000, 1); end elseif (v.State == 'closeTile') then local tileProgress = (getTickCount() - v.Tick) / 350; local tilePosition = interpolateBetween(v.EndX, 0, 0, v.StartX, 0, 0, tileProgress, 'Linear'); local tileWidth = interpolateBetween(v.Width, 0, 0, 0, 0, 0, tileProgress, 'Linear'); if (tilePosition and tileWidth) then v.CurrentX = tilePosition; v.CurrentWidth = tileWidth; else v.CurrentX = v.StartX; v.CurrentWidth = 0; end if (tileProgress > 1) then v.AlphaTick = getTickCount(); v.State = 'fadeOut'; end elseif (v.State == 'fixTile') then v.Alpha = 255; v.CurrentX = v.EndX; v.CurrentWidth = v.Width; end roundedRectangle(v.CurrentX, 20, 25 + v.CurrentWidth, 25, tocolor(0, 0, 0, 150 * v.Alpha / 255), _, true); dxDrawRectangle(v.CurrentX, 20, 25, 25, tocolor(0, 0, 0, 255 * v.Alpha / 255), true); if (v.Alpha == 255) then dxDrawText(v.Text, v.CurrentX + 25 + 10, 20, v.CurrentX + 25 + 10 + v.CurrentWidth - 20, 20 + 25, tocolor(255, 255, 255, 255), 0.40, notificationFont, 'center', 'center', true, false, true); end if (v.Type == 'error') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(215, 90, 90, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'warning') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(220, 180, 80, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'info') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(85, 180, 245, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'success') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(80, 205, 105, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); end end end ) addEvent('addNotification', true); function addNotification(text, type) if (text and type) then if (notificationData ~= nil) then table.remove(notificationData, #notificationData); end table.insert(notificationData, { StartX = (displayWidth / 2) - (25 / 2), EndX = (displayWidth / 2) - ((dxGetTextWidth(text, 0.40, notificationFont) + 20 + 25) / 2), Text = text, Width = dxGetTextWidth(text, 0.40, notificationFont) + 20, Alpha = 0, State = 'fadeIn', Tick = 0, AlphaTick = getTickCount(), CurrentX = (displayWidth / 2) - (25 / 2), CurrentWidth = 0, Type = type or 'info' } ); if (fileExists('files/sounds/' .. type .. '.mp3')) then if (notificationData.soundEffect and isElement(notificationData.soundEffect)) then destroyElement(notificationData.soundEffect); end notificationData.soundEffect = playSound('files/sounds/' .. type .. '.mp3', false); else playSoundFrontEnd(11); end end end addEventHandler('addNotification', root, addNotification); function roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI) if (x and y and w and h) then if (not borderColor) then borderColor = tocolor(0, 0, 0, 200); end if (not bgColor) then bgColor = borderColor; end --> Background dxDrawRectangle(x, y, w, h, bgColor, postGUI); --> Border dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI); -- top dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI); -- bottom dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI); -- left dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI); -- right end end --server function addNotification(player, text, type) if (player and text and type) then triggerClientEvent(player, 'addNotification', player, text, type); end end addEventHandler("onPlayerLogin", getRootElement(), function (player, text, type) local name = getPlayerName ( source ) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then showText(name.." tulajdonosi szolgálatba lépett!", getRootElement(), 255,0,0, true) triggerClientEvent(player, 'addNotification', player, text, type); end end )
  3. No errors, just doesn't show the message sorry for my bad english:c
  4. -- Notifications system local sx,sy = guiGetScreenSize() local r,g,b = 255, 60, 0 local lisrMSG = {} -- The same function as outputChatBoxing to make it more easier. function showText(message) if not (message and type(message) == "string") then error("Bad argument @ 'showText' [Expected player at argument 1, got "..type(message).."]") return false end return table.insert(lisrMSG, {message, getTickCount()}) end addEvent("onClientShowText",true) addEventHandler("onClientShowText", root, showText) alpha1 = 0; -- Rendering. addEventHandler("onClientRender", root, function () if (#lisrMSG > 0) then for i, messages in ipairs(lisrMSG) do text, started = unpack(messages) now = getTickCount() progress = (now-started)/1200 x, w, h = sx/2-(360/2), 360, 20 scale = 1 font = "default-bold" length = dxGetTextWidth(text, scale, font, true) _, y, alpha = interpolateBetween(0, sy, 0, 0, sy-(80+(h*i)), 255, progress, "OutBack") if (progress >= -- s8) --> then table.remove(lisrMSG, i) if alpha1 >= 255 then alpha1 = 255 end end alpha1 = alpha1 + 3; if alpha1 >= 255 then alpha1 = 255; end dxDrawRectangle((x-5)-(tonumber(length)/2)+180, y-1, tonumber(length)+8, h+2, tocolor(r, g, b, alpha1), false) dxDrawRectangle((x-4)-(tonumber(length)/2)+180, y, tonumber(length)+6, h, tocolor(22, 22, 22, alpha1), false) dxDrawText(tostring(text), x, y, w+x, h+y, tocolor(255, 255, 255, alpha1), scale, font, "center", "center", false, false, false, true, false) end end end) -- Joing quit as a test, if you gonna use it out side this script you have to export, method exports.notif:showText("Text") -- carefully do NEVER change this resource name! function text ( ) showText(getPlayerName(source).." #ffffffhas #00ff00bejel#ffffffentkezett.") end addEvent( "loginlogin", true ) addEventHandler( "loginlogin", root, text ) addEventHandler('onClientPlayerJoin', root, function() showText("#00baff"..getPlayerName(source).." #FFffFFJött Kockulni#00baff!") end) addEventHandler('onClientPlayerQuit', root, function(reason) showText("#00baff"..getPlayerName(source).." #df6464Távozott! (Ok: "..reason..").") end) addEventHandler('onClientPlayerChangeNick', root, function(oldNick, newNick) showText("#00baff"..oldNick.." #ffffffnevet váltott:#00baff " ..newNick) end)
  5. --client -- Notifications system local sx,sy = guiGetScreenSize() local r,g,b = 255, 60, 0 local lisrMSG = {} -- The same function as outputChatBoxing to make it more easier. function showText(message) if not (message and type(message) == "string") then error("Bad argument @ 'showText' [Expected player at argument 1, got "..type(message).."]") return false end return table.insert(lisrMSG, {message, getTickCount()}) end addEvent("onClientShowText",true) addEventHandler("onClientShowText", root, showText) alpha1 = 0; -- Rendering. addEventHandler("onClientRender", root, function () if (#lisrMSG > 0) then for i, messages in ipairs(lisrMSG) do text, started = unpack(messages) now = getTickCount() progress = (now-started)/1200 x, w, h = sx/2-(360/2), 360, 20 scale = 1 font = "default-bold" length = dxGetTextWidth(text, scale, font, true) _, y, alpha = interpolateBetween(0, sy, 0, 0, sy-(80+(h*i)), 255, progress, "OutBack") if (progress >= -- s8) --> then table.remove(lisrMSG, i) if alpha1 >= 255 then alpha1 = 255 end end alpha1 = alpha1 + 3; if alpha1 >= 255 then alpha1 = 255; end dxDrawRectangle((x-5)-(tonumber(length)/2)+180, y-1, tonumber(length)+8, h+2, tocolor(r, g, b, alpha1), false) dxDrawRectangle((x-4)-(tonumber(length)/2)+180, y, tonumber(length)+6, h, tocolor(22, 22, 22, alpha1), false) dxDrawText(tostring(text), x, y, w+x, h+y, tocolor(255, 255, 255, alpha1), scale, font, "center", "center", false, false, false, true, false) end end end) function text ( ) showText(getPlayerName(source).." #ffffffhas #00ff00bejel#ffffffentkezett.") end addEvent( "loginlogin", true ) addEventHandler( "loginlogin", root, text ) addEventHandler('onClientPlayerJoin', root, function() showText("#00baff"..getPlayerName(source).." #FFffFFJött Kockulni#00baff!") end) addEventHandler('onClientPlayerQuit', root, function(reason) showText("#00baff"..getPlayerName(source).." #df6464Távozott! (Ok: "..reason..").") end) addEventHandler('onClientPlayerChangeNick', root, function(oldNick, newNick) showText("#00baff"..oldNick.." #ffffffnevet váltott:#00baff " ..newNick) end) --server function showText(message, sendtO) if not (message and type(message) == "string") then error("Bad argument @ 'showText' [Expected player at argument 1, got "..type(message).."]") return false end if not (sendtO) and (isElement(sendtO)) then error("Bad argument @ 'showText' [Expected player at argument 2, got "..type(sendtO).."]") return false end return triggerClientEvent(sendtO, "onClientShowText", root, message) end addEventHandler("onPlayerLogin", root, function () triggerClientEvent("loginlogin", root) end ) ERROR: xy/client.lua:49: attempt to concatenate a boolean value
  6. function arguments expected near '.' wtf?
  7. ERROR:xy\client.lua:13: attempt to call method 'gsub' (a nil value) --client local x, y = guiGetScreenSize() local font_os = (x/1600+y/900)/2 local font = font_os*1 local nSpaceY = dxGetFontHeight(font, "default-bold") local nSpaceYOld = dxGetFontHeight(2, "default-bold") local szovegek = {} for i=0, 4, 1 do szovegek[i] = "" end function itsRenderTime() for i = 0, 4, 1 do if szovegek[i] then local topSpaceX = dxGetTextWidth(szovegek[i]:gsub("#%x%x%x%x%x%x",""),font,"default-bold") local webX=topSpaceX+font_os*10 dxDrawRectangle ( x-webX-font_os*5, nSpaceYOld*2+font_os*8+nSpaceY*(4-i)+font_os*(4-i), webX, nSpaceY+font_os*4, tocolor ( 0, 0, 0, 155 ) ) dxDrawEmptyRec ( x-webX-font_os*5, nSpaceYOld*2+font_os*8+nSpaceY*(4-i)+font_os*(4-i), webX, nSpaceY+font_os*4, tocolor ( 255, 255, 255, 200 ), 2 ) dxDrawText ( szovegek[i], x-webX, nSpaceYOld*2+font_os*10+nSpaceY*(4-i)+font_os*(4-i), topSpaceX, nSpaceY, tocolor ( 255, 255, 255, 255 ), font, "default-bold", "left", "top",true,false,false,true ) end end end addEventHandler("onClientRender", getRootElement(), itsRenderTime) function infoServer2(szoveg) for i = 3, 0, -1 do szovegek[i+1] = szovegek[i] end szovegek[0] = szoveg end addEvent("infoServer2", true) addEventHandler("infoServer2",getRootElement(), infoServer2) function dxDrawEmptyRec(absX,absY,sizeX,sizeY,color,ancho) dxDrawRectangle ( absX,absY,sizeX,ancho,color ) dxDrawRectangle ( absX,absY+ancho,ancho,sizeY-ancho,color ) dxDrawRectangle ( absX+ancho,absY+sizeY-ancho,sizeX-ancho,ancho,color ) dxDrawRectangle ( absX+sizeX-ancho,absY+ancho,ancho,sizeY-ancho*2,color ) end local aValto = true function azEltunteto() if aValto then aValto = false removeEventHandler ( "onClientRender", root, itsRenderTime ) else aValto = true addEventHandler ( "onClientRender", root, itsRenderTime ) end end bindKey("delete","down",azEltunteto) --server local szovegek = {} local result = szovegek --outputChatBox(unpack(result)) addEventHandler('onPlayerChangeNick', root, function(oldNick, newNick) szovegek = { oldNick .. ' is now known as ' .. newNick, 255, 100, 100 } triggerClientEvent ( "infoServer2", getRootElement(), szovegek ) end )
  8. i tried this with this error ERROR:xy\client.lua:13: attempt to call method 'gsub' (a nil value) Wtf?!
  9. No errors, just hide a dxrectangle from upper right corner
  10. deleted, but the dx message doesn't working
  11. no errors, just one warning with this word: WARNING: xy\server.lua:7: Bad argument @ 'outputChatBox' [Expected string at argument 1, got none] what is the solution for this? --client local x, y = guiGetScreenSize() local font_os = (x/1600+y/900)/2 local font = font_os*1 local nSpaceY = dxGetFontHeight(font, "default-bold") local nSpaceYOld = dxGetFontHeight(2, "default-bold") local szovegek = {} for i=0, 4, 1 do szovegek[i] = "" end function itsRenderTime() for i = 0, 4, 1 do if szovegek[i] then local topSpaceX = dxGetTextWidth(szovegek[i]:gsub("#%x%x%x%x%x%x",""),font,"default-bold") local webX=topSpaceX+font_os*10 dxDrawRectangle ( x-webX-font_os*5, nSpaceYOld*2+font_os*8+nSpaceY*(4-i)+font_os*(4-i), webX, nSpaceY+font_os*4, tocolor ( 0, 0, 0, 155 ) ) dxDrawEmptyRec ( x-webX-font_os*5, nSpaceYOld*2+font_os*8+nSpaceY*(4-i)+font_os*(4-i), webX, nSpaceY+font_os*4, tocolor ( 255, 255, 255, 200 ), 2 ) dxDrawText ( szovegek[i], x-webX, nSpaceYOld*2+font_os*10+nSpaceY*(4-i)+font_os*(4-i), topSpaceX, nSpaceY, tocolor ( 255, 255, 255, 255 ), font, "default-bold", "left", "top",true,false,false,true ) end end end addEventHandler("onClientRender", getRootElement(), itsRenderTime) function infoServer2(szoveg) for i = 3, 0, -1 do szovegek[i+1] = szovegek[i] end szovegek[0] = szoveg end addEvent("infoServer2", true) addEventHandler("infoServer2",getRootElement(), infoServer2) function dxDrawEmptyRec(absX,absY,sizeX,sizeY,color,ancho) dxDrawRectangle ( absX,absY,sizeX,ancho,color ) dxDrawRectangle ( absX,absY+ancho,ancho,sizeY-ancho,color ) dxDrawRectangle ( absX+ancho,absY+sizeY-ancho,sizeX-ancho,ancho,color ) dxDrawRectangle ( absX+sizeX-ancho,absY+ancho,ancho,sizeY-ancho*2,color ) end local aValto = true function azEltunteto() if aValto then aValto = false removeEventHandler ( "onClientRender", root, itsRenderTime ) else aValto = true addEventHandler ( "onClientRender", root, itsRenderTime ) end end bindKey("delete","down",azEltunteto) --server local szovegek = {} local result = szovegek outputChatBox(unpack(result)) addEventHandler('onPlayerChangeNick', root, function(oldNick, newNick) szovegek = { '* ' .. oldNick .. ' is now known as ' .. newNick, 255, 100, 100 } triggerClientEvent ( "infoServer2", getRootElement() ) end )
  12. Oh.. rly but I rewrote but not good /sorry for my bad english/ local szovegek = {} addEventHandler('onPlayerChangeNick', root, function(oldNick, newNick) szovegek[i] = ('* ' .. oldNick .. ' is now known as ' .. newNick, 255, 100, 100) triggerClientEvent("infoServer2", source) end ) ')' expected near ',' The issue here is szovegek[i] = ('* ' .. oldNick .. ' is now known as ' .. newNick, 255, 100, 100) You must use { and } to create a table to store those arguments. Try szovegek[i] = { .. contents here .. } instead. To use the result, do this: local result = szovegek[i] outputChatBox(unpack(result)) The "unpack" function will expand a table like `{value1, value2}` into arguments `value1, value2` (and so on) ERROR: xy\server.lua:3: bad argument #1 to 'unpack' (table expected, got nil) but why?
  13. i is the dx joinquit message, but doesn't working
  14. Oh.. rly but I rewrote but not good /sorry for my bad english/ local szovegek = {} addEventHandler('onPlayerChangeNick', root, function(oldNick, newNick) szovegek[i] = ('* ' .. oldNick .. ' is now known as ' .. newNick, 255, 100, 100) triggerClientEvent("infoServer2", source) end ) ')' expected near ','
  15. no errors, but not working, why? --client local x, y = guiGetScreenSize() local font_os = (x/1600+y/900)/2 local font = font_os*1 local nSpaceY = dxGetFontHeight(font, "default-bold") local nSpaceYOld = dxGetFontHeight(2, "default-bold") local szovegek = {} for i=0, 4, 1 do szovegek[i] = "" end function itsRenderTime() for i = 0, 4, 1 do if szovegek[i] then local topSpaceX = dxGetTextWidth(szovegek[i]:gsub("#%x%x%x%x%x%x",""),font,"default-bold") local webX=topSpaceX+font_os*10 dxDrawRectangle ( x-webX-font_os*5, nSpaceYOld*2+font_os*8+nSpaceY*(4-i)+font_os*(4-i), webX, nSpaceY+font_os*4, tocolor ( 0, 0, 0, 155 ) ) dxDrawEmptyRec ( x-webX-font_os*5, nSpaceYOld*2+font_os*8+nSpaceY*(4-i)+font_os*(4-i), webX, nSpaceY+font_os*4, tocolor ( 255, 255, 255, 200 ), 2 ) dxDrawText ( szovegek[i], x-webX, nSpaceYOld*2+font_os*10+nSpaceY*(4-i)+font_os*(4-i), topSpaceX, nSpaceY, tocolor ( 255, 255, 255, 255 ), font, "default-bold", "left", "top",true,false,false,true ) end end end addEventHandler("onClientRender", getRootElement(), itsRenderTime) function infoServer2(szoveg) for i = 3, 0, -1 do szovegek[i+1] = szovegek[i] end szovegek[0] = szoveg end addEvent("infoServer2", true) addEventHandler("infoServer2",getRootElement(), infoServer2) function dxDrawEmptyRec(absX,absY,sizeX,sizeY,color,ancho) dxDrawRectangle ( absX,absY,sizeX,ancho,color ) dxDrawRectangle ( absX,absY+ancho,ancho,sizeY-ancho,color ) dxDrawRectangle ( absX+ancho,absY+sizeY-ancho,sizeX-ancho,ancho,color ) dxDrawRectangle ( absX+sizeX-ancho,absY+ancho,ancho,sizeY-ancho*2,color ) end local aValto = true function azEltunteto() if aValto then aValto = false removeEventHandler ( "onClientRender", root, itsRenderTime ) else aValto = true addEventHandler ( "onClientRender", root, itsRenderTime ) end end bindKey("delete","down",azEltunteto) --server addEventHandler('onClientPlayerJoin', root, function() szovegek[i] = ('* ' .. getPlayerName(source) .. ' has joined the game', 255, 100, 100) triggerClientEvent ( source, "infoServer2" ) end ) addEventHandler('onClientPlayerChangeNick', root, function(oldNick, newNick) szovegek[i] = ('* ' .. oldNick .. ' is now known as ' .. newNick, 255, 100, 100) triggerClientEvent ( source, "infoServer2" ) end ) addEventHandler('onClientPlayerQuit', root, function(reason) szovegek[i] = ('* ' .. getPlayerName(source) .. ' has left the game [' .. reason .. ']', 255, 100, 100) triggerClientEvent ( source, "infoServer2" ) end )
×
×
  • Create New...