Jump to content

Search the Community

Showing results for tags 'fileopen'.

  • 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 2 results

  1. Hi there, I am trying to make a script that loads text from a *.txt file but I keep getting this error, why? addEventHandler("log", getRootElement(), function(message) local f = fileOpen("logs.txt"); fileSetPos(f, fileGetSize(f)); fileWrite(f, time().." "..message:gsub("#%x%x%x%x%x%x", "").."\r"); fileFlush(f); fileClose(f); end); This one works. But when I try like this addCommandHandler("readlog", function(player) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then local f1 = fileOpen("logs.txt"); if f1 then text1 = fileRead(f1, fileGetSize(f1)); fileClose(f1); end triggerClientEvent(player, "show:LOGS", player, text1); end end); It doesn't and I get this warnings fileOpen: unable to load file Bad argument @ 'fileGetSize' [Expected scriptfile at argument 1, got boolean] Bad argument @ 'fileRead' [Expected scriptfile at argument 1, got boolean] Bad argument @ 'fileClose' [Expected scriptfile at argument 1, got boolean] Hmm, if I set the readOnly propriety to fileOpen I only get the unable to load file warning.
  2. Hey, with MTA 1.5.3, the fileOpen function got a new "readOnly" argument. The default value is "false", as it always was. But for some reason, something is different now. I have a script that worked fine for month, but now it throws an error when opening a file that has been in use before. I noticed this on an mp3 file that is played by playSound, and later destroyed again. If I set the "readOnly" argument to "true", it works as it used to, except that I cannot modify the files anymore. (Which in this case I don't need) Nothing in my script changed except clients were updated to 1.5.3. Is this possibly a bug? Bonsai
×
×
  • Create New...