• Announcements

    • jhxp

      Forums are online again after a maintenance.   18/03/17

      MTA Forums maintenance is completed, although some automatic time-heavy tasks are still in process and will be finished eventually in background. Expect some features such as Forum Search to not display all results until all processes are finished. Please let us know if you spot a forum feature that worked correctly before the maintenance but does not work anymore now. Thanks. --MTA Team


  • Content count

  • Joined

  • Last visited

  • Days Won


Necktrox last won the day on January 10

Necktrox had the most liked content!

Community Reputation

12 Decent


About Necktrox

  • Rank
  • Birthday 22/11/95


  • Gang
  • Location
  • Interests

Recent Profile Visitors

377 profile views
  1. --[[ Draw a fancy bounding box: c-----d |\ /| | \ / | | x | | / \ | |/ \| a-----b ]] local minX, minY, minZ, maxX, maxY, maxZ = vehicle:getBoundingBox() local a = vehicleMatrix:transformPosition(Vector3(minX, minY, maxZ)) drawTextOnWorldPosition("a", a) local b = vehicleMatrix:transformPosition(Vector3(maxX, minY, maxZ)) drawTextOnWorldPosition("b", b) local c = vehicleMatrix:transformPosition(Vector3(minX, maxY, maxZ)) drawTextOnWorldPosition("c", c) local d = vehicleMatrix:transformPosition(Vector3(maxX, maxY, maxZ)) drawTextOnWorldPosition("d", d) dxDrawLine3D(c, d, 0xFFFF0000, 1.0) dxDrawLine3D(a, b, 0xFFFF0000, 1.0) dxDrawLine3D(c, a, 0xFFFF0000, 1.0) dxDrawLine3D(d, b, 0xFFFF0000, 1.0) dxDrawLine3D(a, d, 0xFFFF0000, 1.0) dxDrawLine3D(b, c, 0xFFFF0000, 1.0) function drawTextOnWorldPosition(text, vecPosition) local x, y = getScreenFromWorldPosition(vecPosition) if x and y then dxDrawText(text, x, y, nil, nil, 0xFFFFFFFF, 2.0, "default-bold", "center", "center") end end You didn't tell me what you want to do, my previous code segment only solved the question in the first post.
  2. You need OOP enabled: function getElementRotatedBoundingBox(element) local elementMatrix = element:getMatrix() local minX, minY, minZ, maxX, maxY, maxZ = element:getBoundingBox() local minVector = elementMatrix:transformPosition(Vector3(minX, minY, minZ)) local maxVector = elementMatrix:transformPosition(Vector3(maxX, maxY, maxZ)) return minVector, maxVector end
  3. Look at the repository, it has a Makefile e.g. in ml_system. https://github.com/multitheftauto/multitheftauto-modules
  4. addEventHandler("onClientPlayerSpawn", root, function () setPedCanBeKnockedOffBike(source, false) end ) This would prevent any player to be knocked off his bike. Furthermore, this snippet is clientside, because setPedCanBeKnockedOffBike is a clientside-only function.
  5. You have to use cancelEvent in the onPlayerChat event if messageType == 1 and place your /me related code there.
  6. You are missing the socket module for your MTA server. There is a check in place to prevent starting the resource without it, which you probably circumvented, because the resource stops immediately if it's not available.
  7. 1 second 1 minute = 60 seconds 1 hour = 60 minutes = 3600 seconds 1 day = 24 hours = 1440 minutes = 86400 seconds 1 month = 31 days = 744 hours = 44640 minutes = 2678400 seconds 1 year = 12 months = 365 days = 8760 hours = 525600 minutes = 31536000 seconds
  8. https://github.com/Necktrox/mta-discord-bot/commit/da6cd936a57ef106b2c612fd7dec0bc893de216c Fixed, I didn't test this part of the code, because I modified my config to include the "Bot " prefix and never tested it without it. Sorry for any inconvenience.
  9. @LoPollo Did you use this token?
  10. There are 3 parts, the relay server and 2 MTA resources. You can install PM2 (Unitech/pm2) to launch the relay node.js server. You only have to duplicate example.config.json as config.json, make your changes to the configuration and run the relay. Below is a copy of my PM - how to configure the relay. Token Visit Applications @ discordapp.com Create a new application if not done yet or select an existing one Create a bot user for the application Reveal the bot user token (you have to click on 'click to reveal') Copy the entire bot token and paste it into your config (see example below) Note: Do not share this bot token with anybody, because they will have access to the bot user. Passphrase This is a random text passphrase you can set to anything you want. Make sure the MTA resource uses the same passphrase in the configuration, otherwise the MTA resource won't be able to authenticate with the node.js relay. The passphrase is like a login password just to make sure nobody can connect to the node.js relay and send messages/spam without your permission to do so. Example Configuration📋 { "port": 8100, // You can use any port you want "passphrase": "super-secret-password", // You can use any passphrase you want "server": "228439442069651456", // Discord server/guild id from Mr.Green Discord guild "bots": [{ "channel": "race", // Name of the channel the bot communicates on (here: #race, do not include the hash #) "token": "bot.token" // Your secret bot user token (do not share this code with others) }] } Warning: JSON configuration files do not support comments. Remove these.
  11. One the one hand you are forced to keep OOP disabled in any resource, which uses the socket module's functions; and I like to use the OOP methods, because the code looks cleaner and easier to read when you try to understand it. On the other hand, you can restart the event handler resource without interrupting the connection with the Discord relay - I have to admit here, that I didn't have any specific reason not to use one resource, it was personal preference. I actually encode the JSON string with base64 to avoid this issue, see here.
  12. I have released a self-hosted Discord relay some time ago, but didn't bother posting here or adding documentation. @specahawk, you can tell me to remove this post if you don't want to have this advertising in your thread. Anyway, the code is on GitHub (Necktrox/mta-discord-bot) and it's being used by Mr.Green, one unknown guy and my clan's server. It doesn't support any commands, but the implementation is up to you (the bot recognizes commands with dot (.) prefix). It's running perfectly stable for months.
  13. The chat box doesn't work like that. To accomplish your suggestion we would have to assign an unique message id for every chat message. You could use the id to receive, edit and delete a chat message. Feel free to submit a ticket in the bugtracker.
  14. You can use my premake-refactor repository of the modules: https://github.com/Necktrox/multitheftauto-modules
  15. Well, I didn't work on my resource for a long time, but I can also link to newer resources.