Jump to content

ixjf

Members
  • Posts

    647
  • Joined

  • Last visited

Everything posted by ixjf

  1. Ew, no. You're sorting the table for each entry in the table. Sort it before the loop.
  2. ixjf

    Questions

    For your second question, no, children of elements don't move with their parents. You would have to move them manually. For your third question, no, that is invalid syntax.
  3. If I told you, you would know how to reverse what FFS did too. In fact, if anyone told you, they would know how you did it, so it would render your 'protection' worthless, so you better find a way on your own.
  4. You can't open them because they are not in valid format. They are modified image files so that people like you can't quickly get their hands on them.
  5. ixjf

    Questions

    I have already answered your first question here: viewtopic.php?f=148&t=90818#p815878
  6. Yes. "Deathmatch" is just a leftover from what MTA:BLUE was originally supposed to be, a modular core that supported loading different mods. However, the code became bloated and messy with time, and became too tied to that mod.
  7. ixjf

    questions

    It is well explained here: https://wiki.multitheftauto.com/wiki/Ga ... sing_Order Also, any scripting related questions clearly should not be here.
  8. Is this kindergarten?
  9. That's not cool, rather a waste of time. What would you want Cortana for in MTA?
  10. Why on earth would you want to have Cortana integrated to MTA? What's the point?
  11. dxDrawLine3D put the browser in the place of the color argument. Oh my. Someone please end this.
  12. I'm really glad I could help. The problem is that the address 0xB6F5F0 points to the address of structure (it's a pointer to the structure). Assume that 0xDEADBEEF is the address of the structure. 0xB6F5F0 contains the value 0xDEADBEEF, so I need to dereference 0xB6F5F0 (get the value of the address) to get 0xDEADBEEF, and then I can add the offset 0x58C to it.
  13. Oh, sorry. That was my fault. I should be dereferencing the address 0xB6F5F0 which points to the structure, and only then add the offset. void SwitchEngine (bool bStat) { DWORD CPed = *(DWORD*)0xB6F5F0; if (mem.Read <byte> (CPed + 0x46C) == 1) { DWORD dwThis = *(DWORD*)(CPed + 0x58C); DWORD dwFunc = 0x41BDD0; DWORD dwEngineOn = (bool)bStat; __asm { mov ecx, dwThis push dwEngineOn call dwFunc } } }
  14. The function should be like this: void SwitchEngine (bool bStat) { if (mem.Read <byte> (0xB6F5F0 + 0x46C) == 1) { static DWORD dwThis = 0xB6F5F0 + 0x58C; static DWORD dwFunc = 0x41BDD0; DWORD dwEngineOn = (bool)bStat; __asm { mov ecx, dwThis push dwEngineOn call dwFunc } } }
  15. You only need to read 1 byte for the player state, you could have left it as it was. The pointers, however, have to be DWORDs.
  16. You're not reading the address correctly. A pointer is 4 bytes, but you're only reading the first byte.
  17. What value gave you 24? The offset of the player state? Make sure you read only 1 byte.
  18. It's more complicated than that. But if you simply want to switch the engine on/off of the vehicle the player is currently in, according to http://www.gtamodding.com/?title=Memory_Addresses_(SA), the address of the player's CPed structure is 0xB6F5F0, and the offset in that structure to a pointer to the last or currently driven vehicle is 0x58C. To know whether you're actually in the vehicle, you can check offset 0x46C (byte) for the value 1 (in vehicle). It's worth mentioning that the address is for GTA:SA 1.0. The offsets, however, are probably the same on other versions. Edit: The address 0xBA18FC should contain a pointer to the currently driven vehicle. It will be a null pointer if the player is on foot.
  19. ixjf

    [TUT] dxFunctions

    You barely explained what your code was doing, other than a random few comments that won't help. To begin, "For the beginning, create variables": you write 15 lines of code without explaining what anything is for (for your information, you forgot a closing bracket after the last element of dx_button)) - for example, how do the initial 6 lines help you in any way to accomplish what you were supposed to do? You aren't direct to the point, and add a bunch of code that will only confuse the person reading it. You could provide a working example separated from the explanation in the end of the post. "Created? great! Now we create function": Yet again, you just provide a bunch of code without much explanation, expecting a beginner to understand the loadstring call or what that function even does. It would be much cleaner and easier to read as: if ( isVisible ) then Menu () else deMenu () end Of course, then you could also give proper names to your variables and functions. For example, 'ShowMenu' and 'HideMenu', or simply 'SetMenuVisible' and rename your variable to 'isMenuVisible'. And then you finally provide the code that is actually meaningful here - how to detect mouse hover/clicks on a DX rectangle. Again, without much explaining. And that's about it, isn't it? In the end, if you were to write a proper tutorial, it would all come down to a few lines of talk, one or two lines of code and an image to aid understanding the math for the mentally slow, as this is merely comparing whether the cursor is within a given rectangle (mouse_x >= rectangle_x && mouse_y >= rectangle_y && mouse_x <= (rectangle_x + rectangle_width) && mouse_y <= (rectangle_y + rectangle_height)). In fact, a beginner may have bigger chances of understanding how to do it by looking here: https://github.com/KennyShields/LoveFra ... il.lua#L36 than with this "tutorial".
  20. ixjf

    [TUT] dxFunctions

    What is wrong with the use loadstring? You can give more information? It's both ugly and overcomplex. Also, I wouldn't call this a tutorial at all. Where is the explanation? Where is anything? You just put a bunch of lines of code there and expect people to understand it. Do not excuse yourself with "it's my first tutorial" - see, that is the problem with this section - you don't know what you're doing.
  21. Don't mess with OOP if you don't know what it is or you don't even know how to code.
  22. No one told you to install Windows 10 as your main OS.
  23. Just because it is on GitHub doesn't mean it was open sourced.
×
×
  • Create New...