Jump to content

driver2

MTA Contributors
  • Posts

    139
  • Joined

  • Last visited

Everything posted by driver2

  1. Hi, I finally released my speedometer. I wasn't really satisfied with the speedometers that were already there, and of course it's fun to make something yourself. So what is special about this one? It's design is pretty plain, but it's still quite versatile. It includes a speedometer (obviously), but also an altimeter (that shows your height while in a plane/helicopter) and an odometer. I always liked to see an analog odometer in MTA that resembles the ones in real cars (with turning digits), so I made one using dx-functions. It's quite hacky (with dxDrawText and boundingbox/cutting off overlapping text), but it seems to work. Since the scale of the speedometer (0, 20, 40, ..) is not a static picture but instead drawn by dx-functions as well, it can be changed easily. Every vehicle can have it's own scale based on it's approximate maximum speed. And of course there's an extensive GUI that let's each player customize the appearance of the speedometer and save the changes in a local file. Pictures and of course download are in resource center, if you are interested: https://community.multitheftauto.com/index.php?p= ... ils&id=559 Greetings
  2. I still don't know though what to do with my script and whether I can count on the resources starting in the same order clientside, as they were started serverside.
  3. I still don't know though what to do with my script and whether I can count on the resources starting in the same order clientside, as they were started serverside.
  4. Of course they are started in a specific order. When I first 'start x' and then 'start y' 'x' start before 'y'. And the order also matters. When y needs x to work, x needs to be started before y.
  5. Of course they are started in a specific order. When I first 'start x' and then 'start y' 'x' start before 'y'. And the order also matters. When y needs x to work, x needs to be started before y.
  6. Hi, are clientside resource-parts always started in the same order the resource starts serverside. For example if a resource depends on another and a player joins, while both resources were previoulsy started in the correct order. Will this always work? Greetings
  7. Hi, are clientside resource-parts always started in the same order the resource starts serverside. For example if a resource depends on another and a player joins, while both resources were previoulsy started in the correct order. Will this always work? Greetings
  8. Hi, how can I group radiobuttons so that only one can be checked at a time? In HTML for instance, you just give them the same name. But how can that behaviour be achieved in MTA? Do I have to write my own function for that? Greetings
  9. I need to send the distance each player on the server travelled. The more often it is sent, the smoother the display. Would you care to optimize it further, or is it negligible compared to other stuff? I need to do the calculation serverside because I need the checkpoints to do it and I'm not sure if sending all checkpoints to the client is a good idea. I also don't know if all player positions are always available clientside?
  10. Hi, I've been making lots of scripts that use events to communicate. However, I can't really assess which changes might be sensible to optimize network traffic. I want to send something in a pretty small intervall (like 500ms) to all clients, like: triggerClientEvent(client,"onClientEventName",root,"doThis",123456) I can't really tell how much an impact will that really have on the network traffic, also compared to what MTA uses for syncing the other stuff, and thus how much work should be put into optimizing it. Maybe someone can help me and clear up some of the questions: 1. Does it make a difference to trigger the event on all players one by one in a loop or trigger it once to root? 2. Does it make any sense to use shorter Event Names? Of course, in this case having a readable name that is unique might be more important, but still, does it make a difference? 3. Does it make a difference to use a single table in one argument for all the data or to put each chunk of data in argument by itself? 4. Would {123456} instead of {12345,6} save a significant amount given the short intervall? Greetings
  11. Just a quick reference to https://community.multitheftauto.com/index.php?p= ... ils&id=495 in case you haven't noticed.
  12. Suit yourself. Maybe I'll add pictures later, but I'm too lazy now.
  13. You can always just deactivate the var_dump-Function or just search the script for var_dump() calls in order to get them all (every editor should have some kind of search). And you can always simply change the function to use another output method than outputConsole().
  14. Hello, I made a nick protection script to let players protect their nicks from being used by other people. Features: - Kick or change name when using a protected nick without logging in - Make it impossible to change to a protected nick without logging in - Protected nicks can expire after a specified amount of time when they are not used - Admins (or rather players that have been given the right) can protect more nicks and who can also be set to not expire - View currently protected nicks and how long they have been unused - Change a lot of settings - Also includes an optional nickchange spam protection that prevents users from changing their nick too often (it is in the same resource because nick protection also uses cancelEvent() on nickchange sometimes, which can cause problems with the nickchange spam protection) If you think you might find it useful, download it here: https://community.multitheftauto.com/index.php?p= ... ils&id=492
  15. Hello, I made a simple SQLite Browser that also allows to do some basic editing. https://community.multitheftauto.com/index.php?p= ... ils&id=495 Greetings
  16. Hello, I've wrote a function for Debugging, maybe you find it useful: https://wiki.multitheftauto.com/wiki/Var_dump It allows you to check variables for their type and value. If you want to use it, just copy it in the script you need to debug and call it like any other function. Greetings
  17. You may want to use guiGetScreenSize and calculate the position based on that. You could for example take the width of the screen and substract the width of the image. You could also try if you could use the height of the screen to position the image under the radar based on the players resolution.
  18. Would it also be secure to check the player's account on the server, or could the player send another player's player element as his own?
  19. I found out that onMapStarting provides three parameters, mapInfo, mapOptions and gameOptions, of which mapInfo.modename contains the name of the mode. It still don't know how to detect the ranking in DD though.
  20. Hello, I've been searching on the wiki and in the race resource itself, but I couldn't find a non-hacky way, to detect which mode Race is currently running and who finished on what rank in a Destruction Derby. Maybe someone with knowledge of Race can answer this. Greetings
  21. Hi, when you use SQLite in your scripts, it's sometimes nice to know, whether the data made it to the db correctly. Now I could download the registry.db and open it with a SQLite editor, however that is not very convenient. Is there some way to view (and maybe edit) the data on the server directly? Greetings
  22. My point is that there seem to be different versions of Lua used for the server and the client. Or why is one more exact than the other? Why not use the more accurate 'double' version for both?
  23. Hello, I ran into a bit of trouble calculating with big numbers in a clientscript. I investigated into it and it seems the client has a different version of LUA than the server. Apparently there is a "float" and a "double" version, the former being only able to hold exact numbers up to 2^24. With bigger numbers, it doesn't calculate accurately anymore. For example, I tried to calculate with a number representing about a year in seconds (and thus being about 30,000,000), which lead to strange results like that: crun 30000000 + 1 Command results: 30000000 [number] However on the server: run 30000000 + 1 Command results: 30000001 [number] Apparently numbers are internally floating point numbers. If the number gets too big, the floating point is moved and it doesn't store all the digits anymore, which obviously makes the number less accurate and can lead to e.g. the '1' in the example above to not register anymore. Someone else can probably explain it better, since I only just learned about that myself. The question is, can this be changed to work with bigger numbers? Greetings
  24. Nice. Could do some nice stuff with maps and scripting. I wouldn't know how to get more than one player to win though, except extending race itself.
  25. Hi, I would like to know how the units in MTA translate to units like meters? I found some information about GTA units, however I couldn't find information about what MTA uses. It probably uses the same as GTA, but it would still be nice if someone could make a definite statement about that. Also, being somewhat related, how does the value from getElementVelocity() translate to something like kph or mph? Thanks for your help. Greetings
×
×
  • Create New...