Jump to content

myonlake

Members
  • Posts

    2,312
  • Joined

  • Days Won

    41

Everything posted by myonlake

  1. myonlake

    ASE Help

    You can use the PHP SDK library to build your own system for communications. You can call functions on your MTA server remotely from the web server. Pretty good for a bit more advanced stuff, rather than just simple ASE stuff.
  2. Things like this are not "easy" to make. You need to stop asking us for scripts and learn to script yourself.
  3. If you want to do it like that, then you need to have an object, and then you use attachElements to attach the vehicle to the object. Then you move the object, and the vehicle will move with it. This is a pretty lame way of doing the movement, just saying. It doesn't look nice either.
  4. myonlake

    ASE Help

    I personally built my own HTTP functions on my server which my web server then queries every few minutes, caching the details into a JSON file and then reading it out to the visitors on the site. Game-Tracker and Game-State send a UDP packet to the server using the old ASE protocol, having just a 's' character and then it returns all the server ASE information. You can do this with PHP, but not sure how much information you want. Sometimes it's even better to just make it custom if you want to share a lot of data.
  5. You need someone to stream it, obviously. Your server cannot stream pedestrians unless you craft your own rendering system server-side, which is quite heavy. And stupid. What I suggest is you simply disable streaming for a ped element and a vehicle element, and then just control the pedestrian while it's in air. I built a script for this a while ago and it works quite well, just need some math to keep the plane stable.
  6. Your script is never going to work. You need to replace an existing vehicle upgrade or attach an object with a replaced model and texture. It's not as simple as you thought it's going to be.
  7. You cannot have additional custom vehicle models (except replacements), but you can have custom textures applied with shaders.
  8. You have to modify your script-tag in meta.xml by enabling the type attribute for client (type="client").
  9. Well. You could map collisions around the base, or implement a smart collision object which rotates around the colshape correspondingly to the position of the player, so you only need one element for that. It's not going to be easy, so you want to think first. Use securezone and make the timer faster, or then don't use securezone and spend a few days figuring out how to make the difficult code.
  10. It's a ternary operator. Standard solution: and/or A frequently used and highly recommend solution is to combine the and and or binary operators in a way that closely approximates the ternary operator: x = a and b or c x = a and b or c and d or e See the book ProgrammingInLua or ExpressionsTutorial for details on the special properties of these binary operators that allow them to work this way. print('x is ' .. (x < 0 and 'negative' or 'non-negative')) -- this works! The main caveat is that if a or c evaluates to true while b or d respectively evaluate to false, then this expression will not behave exactly like the ternary operator. Here, "evaluate to false" means that the value is either false or nil, and "evaluate to true" means not evaluate to false. In the first line above, a and b or c is interpreted as (a and b) or c (because and has higher precedence than or), and if a evaluates to true, then the expression becomes b or c, and if b evaluates to false, then the expression becomes c (not b as you might want). Often, as in the case of our original example, the second operand of the tertiary operator can never evaluate to false, so you are free to use this idiom, but beware of the caveat. If the b will evaluate to false, change the a so that it evaluates exactly opposite and therefore swaps b and c print((x < 0 and false or true)) -- this fails! print((x >= 0 and true or false)) -- this works! Source: http://lua-users.org/wiki/TernaryOperator
  11. Depends what you mean by warping. Are you using the freeroam resource, or..? If so, then you need to implement your own way to fix it so that you can't warp while x things are enabled. If you're using something else to warp, then we'd need to see the code to help you. To answer your initial question: yes, it is possible, even if you're using the freeroam resource.
  12. myonlake

    string.format

    function getDateTimeString( day, month, year, hour, minute, second ) return ( "%04d-%02d-%02d %02d:%02d:%02d" ):format( year or 0, month or 0, day or 0, hour or 0, minute or 0, second or 0 ) end So technically you can just modify that to your needs like so: function getDateTimeString( day, month, year, hour, minute, second ) return ( "[%02d/%02d/%04d]" ):format( year or 0, month or 0, day or 0 ), ( "[%02d:%02d:%02d]" ):format( hour or 0, minute or 0, second or 0 ) end local dateString, timeString = getDateTimeString( ... )
  13. Yes. It's already being decrypted at runtime. It's just a matter of knowing what they're doing. Generally, you won't see it happening, but otherwise, yes.
  14. myonlake

    browser

    You can use https://wiki.multitheftauto.com/wiki/SetBrowserVolume to edit the volume of the browser. You can create a custom range that way.
  15. You don't need to kill or unassign the timer once it's finished. It's nilled automatically like any other element.
  16. Trailers fail because they have no seats. If you read what getVehicleOccupants results you'd know that it returns false when there's no seats or vehicle element is invalid. function isVehicleOccupied(vehicle) assert(isElement(vehicle) and getElementType(vehicle) == "vehicle", "Bad argument @ isVehicleOccupied [expected vehicle, got " .. tostring(vehicle) .. "]") local _, occupant = next(getVehicleOccupants(vehicle) or {}) return occupant and true, occupant end
  17. No, they said they wouldn't, it's technically quite profitable for both parties involved. Steam is a different platform, their Terms of Service doesn't allow it, Rockstar Games would also re-evaluate their opinions and it would be taken down for good. It's really unlikely to stay long in there, even if intentions are good. And yes, they are already breaking their Terms of Service, but because it's not involving the players, it's seen "fine"... As long as MTA doesn't have micro-transactions, Rockstar and TakeTwo aren't worried. MTA has absolutely zero licenses signed by any of the official parties. Yes, they don't care, but Valve does. Valve can be sued for allowing MTA to be released there without a license. It's all business. The only way for it to work is all parties sign a contract which allows MTA to be released as an official modification and has no way of getting income. Donations are not considered income, as long as that money is reserved for specific use and nothing else; otherwise the person who broke the contract can be sued and that will not be cheap. Better if it's kept this current way unless they really want to try their luck, or unless they go for an official contract. Kudos if they do make a contract.
  18. It means the sound element has not yet been created. Try using startMusic( ) somewhere to create it first.
  19. Yes, but it's not useful if you need the data.
  20. No. He's setting it on 187, but because 'v' is empty or something different than how he uses it, he's getting that error.
  21. What is your 'q' returning? It seems it cannot find v['Username'] or v['JailTime'], hence it throws the error. Maybe the table is constructed some other way?
  22. What about SQL injection . You can simply use the db functions provided by MTA and you're on the clear. Input is never processed, just passed as parameters. Prepared statements ftw. SQL injections works on SQLite too, in both cases you just need to escape the input string and get rid of symbols like these: '=&"*?}{ just to mention a few. You don't need to get rid of anything. That's against the whole idea of saving data. You're manipulating the end result. The only case where I would manipulate data is when I need to display it on a website. Stripping tags, then converting special characters into HTML entities and trimming both ends of the string. Makes it clean and simple.
  23. 645 MB (0.645 GB) is not that much. Other servers can consume over 4 GB of RAM per instance. It just means you have a lot of information in memory. That's all. Large servers consume a lot of memory because they also hold a lot of information. Optimization can be one thing for you: initialize certain parts only when needed, rather than having them all in memory even when not needed. But this is just if 645 MB is too much for you. Servers should have a few gigs of memory, so I wouldn't worry. I haven't checked how much my MTA servers consume memory, so I can't tell if 645 MB is realistic or not for normal use. But it surely isn't enough to raise an alarm.
  24. MySQL provides flexibility, so I say MySQL.
  25. Aww ... now I got it lel. So second.millisecond works fine. Thanks for the reply mate! You're welcome.
×
×
  • Create New...