Jump to content

JR10

Retired Staff
  • Posts

    2,947
  • Joined

  • Last visited

Everything posted by JR10

  1. JR10

    Mysql factions

    You have to be more specific and explain yourself better if you have any hopes of getting help around here.
  2. You're sending a table, not a string. You need to retrieve the first element of that table, which is the string-type message. function infoServer2(szoveg) for i = 3, 0, -1 do szovegek[i+1] = szovegek[i] end szovegek[0] = szoveg[0] end addEvent("infoServer2", true) addEventHandler("infoServer2",getRootElement(), infoServer2)
  3. You should not have commas in your INT-type column. Store the integers without the commas, and format it accordingly whenever you want to present it.
  4. JR10

    Using SQLite

    teamname is not defined in the getTeamData function. getTeamName
  5. JR10

    [TUT] SQLite

    dbExec(db, "CREATE TABLE IF NOT EXISTS `accountdata`(`id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT)") dbExec(db, "CREATE TABLE IF NOT EXISTS `inventory`(`id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT)")
  6. Version 1.3.1 is released. I've had some free time and decided to make a minor update to this resource as it's one of the top downloaded resources. The main change is reverting to CEGUI. This has been requested a lot as some were upset with the dependency on dxGUI. I've also fixed a bug with the output messages. Community Link
  7. Are you selling it or releasing it? If you're releasing it for free then just upload it on the community.
  8. JR10

    How to change?

    Are you talking about the crosshair or the marker itself?
  9. JR10

    [Help] Question

    Loop through the table and check each element.
  10. Try Googling, you'll find more tutorials than you can read. There are some on the forums, but they're probably outdated. This, maybe: viewtopic.php?f=148&t=42067
  11. JR10

    [HELP] Please

    When you restart the resource, you want everyone to have 0 as their kills? If so, the above code should still do that for you: addEventHandler('onResourceStart', root, function() for index, player in pairs(getElementsByType('player')) do setElementData(player, 'Zombie Kills', 0) end end) If you want anyone with 0 kills to have their kills cell empty, then just remove the element data on restart. setElementData(player, 'Zombie Kills')
  12. I've written a Node.js module to facilitate calling http exported functions. It's just a class with one function, 'call'. It was originally part of my web panel project for MTA, but I've decided to release it as a module. It's published on npm, so it's easy to install with: npm install mtasa-sdk Example: var MTA = require('mtasa-sdk'); var server = new MTA(); // [url=http://localhost:22005]http://localhost:22005[/url] server.call(resourceName, functionName, args, callback); For more information, check the GitHub repo: http://github.com/jr10/node-mtasa-sdk
  13. JR10

    [HELP] Please

    How are you going to see the kills if it's not set on join? Players without Zombie Kills as an element data will have an empty value for that column. Try to explain better.
  14. No, it won't. It will still be destroyed, which, in this case, IIYAMA's explanation is correct. Maybe try telling us what you need to achieve here?
  15. JR10

    [HELP] Please

    The second function just doesn't make any sense. addEvent("onZombieWasted",true) addEventHandler("onZombieWasted",root, function (killer) setElementData(killer, "Zombie Kills", getElementData(killer, "Zombie Kills") + 1) end) addEventHandler('onPlayerJoin', root, function() setElementData(source, 'Zombie Kills', 0) end) addEventHandler('onResourceStart', root, function() for index, player in pairs(getElementsByType('player')) do setElementData(player, 'Zombie Kills', 0) end end) Try to not use Zombie Kills as the element data, use something like 'zo' and a friendly name.
  16. -- RESOURCE A local myObject = createObject(...) myObject = exports.B.manipulateObject(myObject) -- RESOURCE B function manipulateObject(object) local anotherObject = createObject(...) return anotherObject end You can send and return any element. So, yes, you can do that. IIYAMA's explanation is irrelevant to your scenario here, if I understood you correctly.
  17. Lua is not an object oriented language, but you can make it so using tables and metamethods. You can mix up both ways in the same resource, since, again, Lua is not really an OO language. In Lua, calling a function with class:function is simply syntatic sugar for class.function(self). For example: myInstance:func(arg1, arg2) -- is the same as myInstance.func(myInstance, arg1, arg2) It's usually the opposite in Lua, you'll mostly use Class.func for static calls and instance:func for instance calls. Here's a few tutorials about OOP and metamethods: http://www.lua.org/pil/16.html http://lua-users.org/wiki/ObjectOrientationTutorial http://www.tutorialspoint.com/lua/lua_o ... iented.htm
  18. Natively, MTA doesn't support other languages than Lua.
  19. I don't know if this is like a practicing project, but, what will this have that the default doesn't?
  20. You don't need to kill the timer inside the timer's function itself, you just need to return and not execute any code. if not thePlayer then return end
  21. I would say, stay away from animations and such. Keep it simple and minimalistic. DOM manipulation with jQuery should be fine. From personal experience, animations were a bit laggy and not as fast. Everything else was fine.
  22. JR10

    Laser

    You want it to look like the picture? And how does it look right now? Are you sure the components are correct?
×
×
  • Create New...