Kareth

Members
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Kareth

  • Rank
    Newbie
  1. Well I wrote this bash script: https://forum.mtasa.com/viewtopic.php?f=106&t=82427
  2. mtasamanager.sh mtasamanager.sh is a standalone Linux bash script that installs, configures and runs a Multi Theft Auto: San Andreas server. The script is able to detect the right packages to be installed on the server, download MTA:SA linux server files and default resources, install them, prompt for the correct configuration such as server name, ports, password... If the script detects an installed server, it will check if the server is running or not, and then ask if it should start or stop the server. It was tested on 32 and 64 bit Debian 7 servers. It should also work on Ubuntu distributions. How to use it: Just place mtasamanager.sh on the directory where you want the server to be installed and run it: chmod +x mtasamanager.sh ./mtasamanager.sh Then just follow the instructions. Execute the script again if you want to start or stop the server. View at GitHubView at Bitbucket Ideas and suggestions are welcome. I never made anything with shell scripts before. So it may be definitely not good enough.
  3. How about posting what you found, so it may be helpful for others in the future too?
  4. Always load the TXD and relace it before the DFF or texture wont load correctly
  5. Indeed, as I mentioned in my first post, that module is only working for Windows.
  6. Kareth

    Guest function

    @karthik_184 Well thats true, i just made the script work as he had it.
  7. Kareth

    Guest function

    exports [ 'scoreboard' ]:addScoreboardColumn ( "Points" ) function refreshData() for k, v in ipairs (getElementsByType("player")) do local account = getPlayerAccount( v ) if isGuestAccount(account) then setElementData( v, "Points", "Guest" ) outputChatBox("Please, log in or register for save points" , v, 255, 0, 0, true) else local data = getAccountData(getPlayerAccount( v ), "Points" ) if data then setElementData( v, "Points", data.." pts" ) end end end end setTimer( refreshData, 1000, 0 ) You were using source instead of v in your outputChatBox Edit: there was also a missing end, try my code Edit2: try to make your code organized taking care of if, else, functions, ends... as easier you make it to read, better for you and for people who will try to help you: exports [ 'scoreboard' ]:addScoreboardColumn ( "Points" ) setTimer ( function () for k, v in ipairs (getElementsByType("player")) do local account = getPlayerAccount( v ) if isGuestAccount(account) then setElementData( v, "Points", "Guest" ) outputChatBox("Please, log in or register for save points" , v, 255, 0, 0, true) else local data = getAccountData(getPlayerAccount( v ), "Points" ) if data then setElementData( v, "Points", data.." pts" ) end end end end, 1000, 0)
  8. Hello everyone, few days ago I was working on a system to communicate a server with a SMF forum, letting players to login using their forum account. SMF engine saves users passwords as a sha1 string, and I started to look for a way of creating a sha1 hash of the password given by players on MTA to compare with the hash on forum database. Since lua does not have such function and MTA provides md5 function only (And there is also a hashing module by mabako if I remember well, but just working for windows), I came out with two possible solutions: using callRemote and making a sha1 hash on a php script was my first option, but I didnt liked the idea of sending the plain text password on a call. So I found over the internet a guy who made a function to generate sha1 hashes in lua. I decided to share it here hoping it will be useful for someone else. You can find it in the author's web in here: http://regex.info/blog/lua/sha1 I tested it and works absolutely perfect and solved my needs. Syntax for the function is: string sha1 (string str) An example would be: outputChatBox (sha1("Password")) which would output in chat the next string: 8be3c943b1609fffbfc51aad666d0a04adf83c9d I just hope this will be useful for someone else as it was for me. And once again, all credits goes to Jeffrey Friedl ( jfriedl@yahoo.com , http://regex.info/blog/ ) Regards