Jump to content

Noki

Members
  • Posts

    850
  • Joined

  • Last visited

Everything posted by Noki

  1. Anubhav, the equals sign always goes on the right. local var = 4 if (var <= 3 and var >= 5) then -- Code end
  2. Noki

    about default gui

    I don't think GUI elements use much memory at all. As long as you don't have thousands of concurrent visible GUI elements at any one time, you should be fine.
  3. Noki

    Wrist Support

    Would I buy it? Probably not. 33 USD for one (plus shipping - considering I live in Australia) is a bit much, to be honest. The product looks cool and I suppose I'd rather purchase it than get CTS down the line.
  4. Noki

    Twitch Streaming

    Make sure the domain is whitelisted and any external sites it fetches client-side data from are also whitelisted. I believe there's a function that opens a window for you to confirm this (requestBrowserDomains from memory).
  5. Noki

    Player blips

    local blips = {} function addPlayerBlip() blips[source] = createBlip(...) end addEventHandler("onPlayerJoin", root, addPlayerBlip) function removePlayerBlip() if (blips[source]) then destroyElement(blips[source]) blips[source] = nil end addEventHandler("onPlayerQuit", root, removePlayerBlip) Of course it's a bit more complex, but this should serve as a good basic rubric to work off.
  6. Wine has issues running the embedded CEF framework. If you want to play MTA on Linux, use a virtual machine of some sort (see VirtualBox or VMware) because a Linux client for MTA is about as likely as Windows going open source.
  7. I believe it is, as admin uses runcode, which allows you to execute Lua code like any other resource. So if I ran function foo() outputChatBox("Someone is using runcode", root) end in runcode, then called 'foo()' after it or in another runcode command, it would output the message to all players. I've seen people use runcode with loops and timers before. So basically anything you can do in a normal script, you can do in runcode. It's quite the handy tool.
  8. Noki

    Date comparing

    I would recommend using Unix timestamps in the future. They are much easier to compare in both Lua and MySQL. You will have to use MySQL's `STR_TO_DATE` function to convert your date into YYYY-MM-DD HH:MM:SS format, then convert that into a timestamp using `UNIX_TIMESTAMP` (with your previous date conversion as an argument). Then you can compare that with `UNIX_TIMESTAMP()` (note the lack of arguments), which is the current Unix timestamp. Quite tedious to be honest. Something like this: dbQuery(db, "SELECT `column1` FROM `table` WHERE UNIX_TIMESTAMP() - UNIX_TIMESTAMP(STR_TO_DATE(`column2`, '%Y %m %d %h:%i%p')) >= 32")
  9. In the ped block, there should be one called 'pass_Smoke_in_car'. Unfortunately, as the name suggests, it's a smoking animation. Though there is a part of it where a ped's hands are together in a cuffed-like state. You can use setAnimationProgress to keep the animation on that frame.
  10. In the ped block, there should be one called 'pass_Smoke_in_car'. Unfortunately, as the name suggests, it's a smoking animation. Though there is a part of it where a ped's hands are together in a cuffed-like state. You can use setAnimationProgress to keep the animation on that frame.
  11. No, pairs is never faster than ipairs or a simple sequential loop (for i = 1, #table do). If you're iterating over a list with perfect pairs (sequentially, where there are no nil pairs), use ipairs or the other sequential loop. The only time when you ever use pairs is when the indexes are not integers or you have imperfect pairs. http://stackoverflow.com/questions/1258 ... s-in-table http://stackoverflow.com/questions/8955 ... a-for-loop Since the OP is iterating over a polled SQL result, the resultant table will have perfect pairs. He can use ipairs or i = 1, #table for optimal speed.
  12. No, pairs is never faster than ipairs or a simple sequential loop (for i = 1, #table do). If you're iterating over a list with perfect pairs (sequentially, where there are no nil pairs), use ipairs or the other sequential loop. The only time when you ever use pairs is when the indexes are not integers or you have imperfect pairs. http://stackoverflow.com/questions/1258 ... s-in-table http://stackoverflow.com/questions/8955 ... a-for-loop Since the OP is iterating over a polled SQL result, the resultant table will have perfect pairs. He can use ipairs or i = 1, #table for optimal speed.
  13. At least try it before dismissing it.
  14. At least try it before dismissing it.
  15. It's probably worth notifying the devs about this. However, see what enabling asynchronous loading does.
  16. It's probably worth notifying the devs about this. However, see what enabling asynchronous loading does.
  17. You can always write your own module.
  18. A complete copy of CIT... But, I can appreciate the fact you mirrored that script (as well as others) to near perfection. Hell, I would say you made some of them even better than CIT did.
  19. You can find it in the map editor by hovering your cursor over it (if it has a LOD and it's a world object). If the object doesn't have a LOD, you can just use the same object or make your own LOD.
  20. https://forum.multitheftauto.com/viewtopic.php?f=91&t=96869 Here's a link to what it looks like in practice with custom objects. I tried the LOD method that IIYAMA suggested, but that never worked for me.
  21. #table["Exhaust"] The # operator is used to find the length of strings and tables with integer keys.
  22. That makes much more sense. What if you were to encrypt the data with a private key? That would make it very hard to modify the data stored client-side.
×
×
  • Create New...