Jump to content

DiSaMe

Helpers
  • Posts

    1,461
  • Joined

  • Last visited

  • Days Won

    34

Everything posted by DiSaMe

  1. Another reason is because the variable John is not defined. If you want to get the element from ID, use this function: getElementByID
  2. If you want to make a server without putting any value in it, you will fail anyway, only wasting your time, so it's not even worth trying. Excuse me, but that's not true. No one can be saved by anyone else. We must find the path to salvation ourselves, like Gautama Buddha did.
  3. Maybe because you use an undefined variable (forwards) rather than a string ("forwards") in setPedControlState?
  4. setPedControlState setPedCameraRotation
  5. All global variables are stored in the table _G with their names as keys. So myFunctionName is _G["myFunctionName"]
  6. Oops, sorry. But still, you need toggleControl for this. And combine it with some other function for actual key state detection, such as bindKey. So pressing the key will not change the running state directly, but instead, the script should detect when it's pressed too quickly and only change the control state when the delay between presses and releases is long enough.
  7. DiSaMe

    Bad arguments

    Variable "player" is not defined.
  8. No need to mess with timers for this. Creating the ped and setting the rotation and interior is enough. Elements are created in dimension 0, so you don't need to set it either. The script looks fine for me, you better check if it gets executed at all using output functions, such as these: outputChatBox outputServerLog outputDebugString
  9. https://wiki.multitheftauto.com/wiki/OnPlayerWasted https://wiki.multitheftauto.com/wiki/OnPedWasted
  10. {} [ ] = == if then else end
  11. You can draw your own license plate over this one dxDrawMaterialLine3D
  12. setPedCameraRotation setPedAimTarget setPedControlState
  13. DiSaMe

    Script help

    Oh, didn't notice that. Anyway, did you try outputting messages to see which parts of the code are executed when they should?
  14. DiSaMe

    Script help

    It doesn't work because the the order in which the code is executed is relevant. You use addEventHandler on functions which have not been created at the top of the script.
  15. MTA map editor is for MTA, not for SA-MP or whatever else you could think of. Such questions completely unrelated to the intended usage of MTA clearly don't fit in MTA forums. Using the best multiplayer with almost unlimited possibilities just to get rid of all advantages later by converting the map to the inferior program's format is a big fail, after all.
  16. I have a simple idea for script multithreading on both server and client: a Lua state for every thread. In addition to the main thread which runs MTA/GTA SA and Lua scripts, there could be 'secondary' threads running separate Lua states on different CPU cores. So one thread would still run synchronously with the game, while other threads run in parallel. A thread could be created from another thread using some scripting function. However, I'm not sure how much the performance would be improved. Since Lua states do not share the variables, the data would have to be sent from one thread to another using signals (another scripting function) and that means copying as much data as there is sent. If lots of calculations are done on small amount of data, then it's fine. But if you do very simple operations on lots of data, it will be useless, since the time spent on sending data from one thread to another could be used by performing the operation on one thread. In conclusion, script multithreading could be done, but it would have limited functionality, resulting in reduction of performance gain.
  17. We don't need them. MTA has scripting for a reason. Seriously, we've had enough of this. First, bone attachments, then NPC traffic, and now, video player. If you are given powerful scripting capabilities, make use of them before asking for more.
  18. addEvent addEventHandler triggerServerEvent
  19. I didn't say I would release it, did I?
  20. Actually, csmit195 tells the truth. Learning a programming language is one of the easiest and shortest, but also the least meaningful processes. For example, I learned PHP in a few hours (could have done even faster) and even though I have only done basic things with it, I know I could do something not so basic (such as forum). The point is, the programming language is just a tool. The tool doesn't make an artist. Experience does. It's not a few hours of learning PHP that makes me capable of scripting a forum. It's programming experience gained in years of programming and logical thinking. So if you just need to learn Lua, go to http://www.lua.org and read the manual. If that doesn't make the Lua scripting simple for you, then the problem is not about Lua. It means you need practice. Like many other activities, programming is not something you can "learn". It's something that gives you experience without reaching a point where everything possible is already done, since there are no limits. You can always go further.
  21. Ratio of HUD element and screen widths is always the same. Ratio of heights is proportional to the aspect ratio. There's no direct way to get the aspect ratio setting, but you can workaround this with a function: getWorldFromScreenPosition
  22. Cancelling onPlayerDamage has no effect. Use onClientPlayerDamage in a client-side script instead.
  23. DiSaMe

    is this done?

    If you reload every full frame, then it will lag, there's nothing surprising about that. I've attempted to make a video player and even though it didn't come out well, there are many things to optimize. You see, the code works faster when you make optimizations rather than asking someone else to make them.
  24. Well, if you provide some screenshots which clearly show how "disastrous" the coordinates are, I may change my opinion. But as for now, I don't see what's wrong, since I have been scripting on MTA for more than 5 years and have never had any problems with that, nor I have any idea how an error in the relative-to-absolute calculations could be made, so I view the system of relative coordinates as simple and perfect with no possibility of some point being in different positions on different resolutions.
×
×
  • Create New...