Jump to content

Search the Community

Showing results for tags 'guicreatestaticimage'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 3 results

  1. Hello! I ran into some problems while coding: Server: function VoteSystem(title) outputChatBox ("Your Vote Title: " .. title, client) end addEvent("VoteConnection", true) addEventHandler("VoteConnection", resourceRoot, VoteSystem) Client: sx, sy = guiGetScreenSize() ClientGUI = {} function VoteCommand (commandName, ...) local title = table.concat ( { ... }," " ) TextDraw = tostring(title) triggerServerEvent ( "VoteConnection", resourceRoot, tostring(title) ) outputChatBox(title) end addCommandHandler ( "vote", VoteCommand ) --ClientGUI[3] = guiCreateStaticImage( sx*0.03, sy*0.03, sx*0.5, sy*0.5, "/files/BG.png", false ) guiMoveToBack(ClientGUI[3]) addEventHandler("onClientRender", root, function() ClientGUI[2] = dxDrawRectangle(sx*0.2, sy*0.3, sx*0.6, sy*0.5, tocolor(0,0,0,150)) ClientGUI[1] = dxDrawText(TextDraw, sx*0.21, sy*0.31, sx, sy, tocolor(255,0,0,255), 2) end) After running the code and entering /debugscript 3, the following error appears: WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] [DUP x213] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] [DUP x214] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] [DUP x215] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] [DUP x213] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] [DUP x212] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] [DUP x79] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] [DUP x71] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] [DUP x87] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] But the code works and by writing /vote [text], the text [text] is entered into dxDrawText How do I fix the error? The second problem: In the client file: sx, sy = guiGetScreenSize() ClientGUI = {} --General function VoteCommand (commandName, ...) local title = table.concat ( { ... }," " ) TextDraw = tostring(title) triggerServerEvent ( "VoteConnection", resourceRoot, tostring(title) ) outputChatBox(title) end addCommandHandler ( "vote", VoteCommand ) ClientGUI[3] = guiCreateStaticImage( sx*0.03, sy*0.03, sx*0.5, sy*0.5, "/files/BG.png", false ) -- Image Background guiMoveToBack(ClientGUI[3]) addEventHandler("onClientRender", root, function() ClientGUI[2] = dxDrawRectangle(sx*0.2, sy*0.3, sx*0.6, sy*0.5, tocolor(0,0,0,150)) ClientGUI[1] = dxDrawText(TextDraw, sx*0.21, sy*0.31, sx, sy, tocolor(255,0,0,255), 2) -- Title end) --General ENDho How do I put " ClientGUI[3] = guiCreateStaticImage( sx*0.03, sy*0.03, sx*0.5, sy*0.5, "/files/BG.png", false )" under "ClientGUI[1] = dxDrawText(TextDraw, sx*0.21, sy*0.31, sx, sy, tocolor(255,0,0,255), 2)" ?
  2. Hello, I am trying to make a script that swaps the image on screen for a new one from a table I really am lost and dont have idea what to do next, local screenW, screenH = guiGetScreenSize() local randomize2 = math.random ( #Imagens ) local alpha = 255 local current_image = "" function ImageRender(image,alpha) if getElementData (getLocalPlayer( ),"logedin") == false or getElementData (getLocalPlayer( ),"logedin") == nil then current_image = guiCreateStaticImage(0, 0, screenWidth, screenHeight, tostring(Imagens[image]), false) guiMoveToBack( current_image ) guiSetAlpha(current_image, alpha ) end end addEventHandler("onClientResourceStart", resourceRoot,ImageRender) function RenderImageSwap() if getElementData (getLocalPlayer( ),"logedin") == false or getElementData (getLocalPlayer( ),"logedin") == nil then if (alpha > 0) then newAlpha = alpha < 25 if (newAlpha < 0) then ImageRender(randomize2,255) else ImageRender(current_image,newAlpha) end end end end setTimer( RenderImageSwap, 1000, 0) This is my code right know, which unfortunately, isnt working at all, does anyone know how to make a fade out an image (set alpha to alpha - 25.5 in a duration of 10 seconds for example) and if it reaches zero, it fades the next one in (set alpha of new image to alpha + 25.5 in a duration of 5 seconds for example) thanks I really tried my best but I dont know what functions to use, was thinking on getCurrentTick but I dont get how it works
  3. Всем привет, есть вопрос. В моём ресурсе после загрузки файлов, люди получают фоновую картинку и Окно GUI. Фоновая картинка грузится таким образом: welcome_gui = guiCreateStaticImage(0, 0, screenW, screenH, "welcome.jpg", false) Далее появляется gui window где форма входа. При этом картинка на заднем фоне перекрывает чат, где выводятся сообщения об ошибках при вводе данных. Как сделать картинку на заднем плане от чата? Спасибо, а то его совсем не видно за ней.
×
×
  • Create New...