Jump to content

Search the Community

Showing results for tags 'bad argument'.

  • 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 4 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. My previous topic was blocked just like that, there was nothing, even comments and advertisements that could violate the forum rule. Please help fix the warnings
  3. Hello to all. I'm getting warnings like this, how can I fix them? WARNING: S\admin_sys.lua:21: Access denied @ 'addAccount' WARNING: S\admin_sys.lua:22: Bad argument @ 'setAccountData' [Expected account at argument 1, got nil] WARNING: S\admin_sys.lua:38: Bad argument @ 'getAccountData' [Expected account at argument 1, got boolean] WARNING: S\admin_sys.lua:39: Bad argument @ 'passwordVerify' [Expected string at argument 2, got boolean] local MINIMUN_PASSWORD_LENGTH = 6 local function isPasswordValid(password) return string.len(password) >= MINIMUN_PASSWORD_LENGTH end addCommandHandler('reg', function (player, command, username, password) if not username or not password then return outputChatBox('SYNTAX: /' .. command .. ' [username][password]', player, 255, 255, 255) end if getAccount(username) then return outputChatBox('An account already exists with that name.', player, 255, 100, 100) end if not isPasswordValid(password) then return outputChatBox('The password supplied was not valid.', player, 255,100,100) end passwordHash(password, 'bcrypt', {}, function (hashedPassword) local account = addAccount(username, hashedPassword) setAccountData(account, 'hashed_password', hashedPassword) outputChatBox('Your account has been successfully created! You may now login with /log', player, 100, 255, 100) end) end, false, false) addCommandHandler('log', function (player, command, username, password) if not username or not password then return outputChatBox('SYNTAX: /' .. command .. ' [username] [password]', player, 255, 255, 255) end local account = getAccount(username) if not account then outputChatBox('No such account could be found with that username or password.', player, 255, 100,100) end local hashedPassword = getAccountData(account, 'hashed_password') passwordVerify(password, hashedPassword, function (isValid) if not isValid then return outputChatBox('No such account could be found with that username or password.', player, 255, 100,100) end if logIn(player, account, hashedPassword) then return outputChatBox('You have successfully logged in!', player, 100,255,100) end return outputChatBox('An unknown error occured while attempting to authenticate.', player, 255, 100, 100) end) end, false, false)
  4. First of all, sorry for bad English. I am creating a script and I used the getElementData function to get data stored in the user account and then the setElementData function to get the information through the getElementData on the client but the script has the following error in debugging: Bad argument @ setElementData [Expect element at argument 1, got nil] SCRIPT: [SERVER-SIDE] function setarDados_Entrar(source) local acc = getPlayerAccount(source) local habl = getAccountData(acc, "hablt") local ficha = getAccountData(acc, "fichacriminal") setElementData(source, "hblt", habl)--In that error line setElementData(source, "fich", ficha) -- In that error line end function setarDados_Iniciar() local acc = getPlayerAccount(player) local habl = getAccountData(acc, "hablt") local ficha = getAccountData(acc, "fichacriminal") setElementData(player, "hblt", habl)--In that error line setElementData(player, "fich", ficha)--In that error line end function setarDados_Mudar(player) local acc = getPlayerAccount(player) local habl = getAccountData(acc, "hablt") local ficha = getAccountData(acc, "fichacriminal") setElementData(player, "hblt", habl)--In that error line setElementData(player, "fich", ficha)--In that error line end addEventHandler("onPlayerLogin", getRootElement(), setarDados_Entrar) addEventHandler("onResourceStart", root, setarDados_Iniciar) addEventHandler("onAccountDataChange", root, setarDados_Mudar)
×
×
  • Create New...