Jump to content

GTX

Members
  • Posts

    1,273
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by GTX

  1. GTX

    Returns nil... Why?

    I'd like to use these, but in this case I will use mysql_connect, mysql_query... I can't find solution why it returns nil...
  2. Hello. I was trying to make "protection" for my script. function CHECKING() result = mysql_query(connect_mysql_check, "SELECT name FROM granted") if (result) then while true do local row = mysql_fetch_assoc(result) if not row then break end if getParticalServerName(row.name) then CONNECT() else WRONG() end end end mysql_free_result(result) end connect_mysql_check = mysql_connect(host, user, password, database_, 3306, "/var/run/mysqld/mysqld.sock") if not connect_mysql_check then outputChatBox("#FF8800[TOPTIMES] #FF6565Could not connect with MySQL Server.", getRootElement(), 255, 255, 255, true) else setTimer(CHECKING, 500, 1) end local row = mysql_fetch_assoc(result) at line 4 returns nil. Why?
  3. GTX

    PHP SDK problem

    Ah, I was a bit confused... Thank you!
  4. GTX

    PHP SDK problem

    Ah yes, I noticed. Thank you! But it still doesn't write to servers.txt
  5. GTX

    PHP SDK problem

    Oh, forgot to ment. Well, it doesn't write anything in servers.txt. Also, doesn't return "1".
  6. GTX

    PHP SDK problem

    Hello. I wanted to insert server name to servers.txt file. And now I had problem: LUA: function result(str) outputChatBox("#FF8800[TOPTIMES] #FF6565Fetching data...", getRootElement(), 255, 255, 255, true) if str ~= nil then if str == "ua" then outputChatBox("#FF8800[TOPTIMES] #FF6565Your license is not valid! Please, contact GTX#!", getRootElement(), 255, 255, 255, true) if str == "1" then outputChatBox("#FF8800[TOPTIMES] #FF6565Data fetched! Welcome!", getRootElement(), 255, 255, 255, true) if str == "0" then outputChatBox("#FF8800[TOPTIMES] #FF6565Terminating script...", getRootElement(), 255, 255, 255, true) outputChatBox("#FF8800[TOPTIMES] #FF6565STEALERS ARE NOT WELCOME!", getRootElement(), 255, 255, 255, true) outputChatBox("#FF8800[TOPTIMES] #FF6565PLEASE, RE-LICENSE THIS BY ASKING GTX#!", getRootElement(), 255, 255, 255, true) stopResource(getThisResource()) end end end end end function check_license() --outputChatBox"sending" callRemote("http://128.204.203.114/mta/toptimes_protection.php", result, getServerName()) --outputChatBox(getServerName()) --outputChatBox"sent" end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), check_license) PHP (SDK): <?php include("sdk/mta_sdk.php"); $table = mta::getInput(); $text = $table[1]; if(isset($text)){ $file = "servers.txt"; $fh = fopen($file, 'a+'); $stringData = $text; fwrite($fh, $stringData."\n"); fclose($file); } $code = "1"; mta::doReturn($code); ?>
  7. Yes, I installed MySQL server first. I'm running my server on Debian 64bit. MySQL works fine without innodb, networking and locking.
  8. I tried to reinstall, reboot and it didn't work. I'm hosting on domVPS.com.
  9. GTX

    MySql help

    He already posted his ACL, and he added the sql resource to ACL. As far as I remember, admin doesn't rights to command "shutdown"
  10. GTX

    MySql help

    Did you wrote correct password? Try by creating new user.
  11. GTX

    MySql help

    Did you put libmysql.dll into your folder where MTA Server.exe is?
  12. Hello. I got problem with MySQL. I don't know if it's a bug or problem but it outputs this when I start the server: ERROR: Unable to connect to mysql: (2002) Can't connect to local MySQL Server trought socket '/var/lib/mysql/mysql.sock' (2) It's running on a VPS, I guess I installed MySQL correctly. Any idea? Thanks in advance.
  13. GTX

    MySql help

    Did you add / to mtaserver.conf?
  14. GTX

    I'm confused..

    Oh yes, I forgot to remove it. Thank you both!
  15. GTX

    I'm confused..

    Hello, I don't know why this is but I got problem "attempt to concatenate a boolean value" function getRaceAlivePlayers() local result = {} local _getAlivePlayers = getElementsByType("player") for i, v in ipairs(_getAlivePlayers) do if getElementData(v, "state") == "alive" then table.insert(result, v) end end return result end function get() local ap = 0 local _getAlivePlayers = getElementsByType("player") for index, player in ipairs(_getAlivePlayers) do if getElementData(player, "state") == "alive" then ap = ap + 1 end end return ap end -- -- addEventHandler("onPlayerWasted", root, function() if get() == 1 then outputChatBox(getPlayerFromName(tostring(getRaceAlivePlayers()[1])) .. " has won") end end ) Thanks in advance
  16. Car mod: https://community.multitheftauto.com/index.php?p= ... ls&id=4080
  17. GTX

    fix . .

    Type /debugscript 3 and tell us what's the problem
  18. GTX

    Problem with text

    What the... Use [lua] [ /lua] tags and also we will not do it for you, learn LUA.
  19. I'm just wondering, because I have no idea how to get attacker!
×
×
  • Create New...