Jump to content

DEFCON1

Members
  • Posts

    67
  • Joined

  • Last visited

Everything posted by DEFCON1

  1. Take a look at this post, I think it's exactly what you need. https://forum.multitheftauto.com/viewtop ... 86#p312307
  2. It was discussed that GTA units are meters and that a multiplier of 160.9 make no sense, at all. The most accurate formula is, based on how much meters are travelled in one second: For KM/H: math.sqrt( (velX * velX) + (velY * velY) + (velZ * velZ) ) * 184 For MP/H: math.sqrt( (velX * velX) + (velY * velY) + (velZ * velZ) ) * 114.33 (Using sqrt is more efficient than using exponents) And about your question, you could do like that: local unitsString = "km/h" local speedMultiplier = 184 function getspeed() return math.sqrt( (velX * velX) + (velY * velY) + (velZ * velZ) ) * speedMultiplier end function toggleUnits() if unitsString == "km/h" then unitsString = "mph" speedMultiplier = 114.33 else unitsString = "km/h" speedMultiplier = 184 end end addCommandHandler( "ToggleSpeedoUnits", toggleUnits ) function drawspeed() dxDrawText( tostring( math.floor( getspeed() ) ), 911.0, 654.0, 982.0, 685.0, tocolor(255,255,255,255), 1.0, "bankgothic", "right", "left", false, false, false) dxDrawText( unitsString, 989.0, 664.0, 1019.0, 680.0, tocolor(255,255,255,255), 1.0, "default", "top", "left", false, false, false) end addEventHandler("onClientRender", getRootElement(), drawspeed) For showing or hiding speedometer, same principle as toggleUnits but use add/RemoveEventHandler("onClientRender", .... ). You could make it more advanced and beautiful by making it fade in/out when you enter/leave vehicles.
  3. Yes I agree. Some times ago I've worked on this feature but I lost all my work so... yeah, may I will try again. I remember I was stuck to adding language files in the installer and how to set the default language from the installer itself, rather than installing in english and then selecting manually the language in MTA. Then a lua function such as getPlayerLanguage( player ) will be useful, so people can start making multilingual resources easily.
  4. Why not compiling the server as well ? Just build the whole solution and it should work
  5. Bah, to be honest, when I did that it was in sa-mp, with a custom streamer... now I've just tested to convert it for use in mta and it looks like total crap x) Well, not that bad but the max draw distance isn't enough on this case. And also it crashed my game while I was flying around with an hydra (I don't think mta's streamer was made to handle 40000+ objects lol) Let's say it's not suitable for the whole map, but for a small area as he want, it might work well.
  6. Problem solved, thanks to Flobu! For people who may have the same problem: open .../MTA10_Server/version.h, and change VERSION_TYPE_RELEASE to VERSION_TYPE_CUSTOM.
  7. I suggest you look here: http://www.game-monitor.com/search.php? ... cation=500 You can list servers by how far they are located, this should help you
  8. That's it probably. I tried in my custom build, I set it to 1 every frame and I don't die.
  9. Having clientside config files? There is no point to do this, your MTA client does have those coordinates stored in memory. I suppose the server send them only once or, only when it need to be updated. And your client check if you entered a pickup, but it still need to send some data to let the server know that you picked up something. I use someone's wifi (max 100kb/s), but I don't have that much lag in games... You must have a really crap connexion!
  10. Sorry I was wrong, I think the correct address is 0x00B7CDE0 which normal value is 1000.0, and as expected, a value of 0 is when you start losing health 'normally' (with a value of 30, you lose health only if you swim, but if you don't move, you don't lose health)
  11. Address is 0x00B7CDE2. Value when bar is full: 17530, not sure for when bar is empty, but around 16900.. I froze it in Cheat engine and the bar doesn't decrease when under water, and player can't die from drowning. Now searching address of how fast it decrease/increase (I found it earlier I think, but now I've lost it..)
  12. I start to get it It's like, "this sound effect need the same value than an existing one used to display a part of the hud, so let's use this existing value!", lol! So from what I understand, it is needed to create a new variable with a similar value, and tell gta_sa.exe to use this new value for our needs, instead of the default one that is used for something else. But I have really no idea how to do that, especially within an external program such as MTA. Is there any MTA function that use this method, so I could study that ? I let you do the MTA patch of course, you probably know much more than I do. In fact I don't even care about those misaligned texts (but MTA team probably does)... at least I've learned how to find some basic addresses lol Oh, also you should obviously test with the original HUD, as it looks like a scripted hud PS: I agree for your FOV fix, it is definately needed.
  13. I don't get it, NTAuthority. I think everything is fine with the actual FOV in MTA (when the Widescreen option is enabled). And more importantly: does YOUR fix make the vehicle name's text and zone name's text to the middle of the screen, as the original 4/3 display ? Or they move at the right side of the screen? Mine have this problem, and I don't think that it is fixable... Also I searched for addresses to move and resize individual parts of the hud,the only one I found which does not cause problems, is the health bar... I have found for the radar but this also affect the armor/breath bars so it's unusable. Something else I've found, it also affect the audio volume (wtf), or even vehicles's tire's width!... many problems like that lol
  14. Not really. As I also want to retrieve the mouse cursor position, even if that cursor isn't visible... But I think that's impossible, for now anyway. I just wanted to do a radial menu today, likein left 4 dead. It's actually very cool, only..well, you have to move the cursor to select the item.. I may release it soon since I can't finish it as I want.
  15. DEFCON1

    Leader

    Namorek, use google translator, then maybe someone will understand what you mean
  16. In a clientside script, but as I said, showCursor(true, true) is not what I want! I want to hide the cursor but lock the camera so when the player move his mouse, it does nothing to his screen but my script handle the mouse movements to calculate something. I tried to lock the camera using get/setCameraMatrix, but then I have a problem to unlock it, I can't find a better way than doing setCameraTarget, which look crappy as I don't want the camera to move to the back of the player...
  17. Hi all, I wanted to ask on IRC but it seem to be down at the moment, as well as gtaforums.com. I would like to disable mouse movements in game when I press a key on my keyboard (let's say "w") I don't know how to explain... imagine that I want to make like when a GUI is shown on player screen: the cursor show, and then he can move the mouse without affecting the camera in the game. I want to do the same thing, but without any GUI or cursor showing. So I tried to use showCursor: showCursor( false, true ) -> I can still use the mouse to move the camera. Like if this function wasn't called. showCursos( true, true ) -> camera is locked, but mouse cursor is visible. Any idea ? Also,I would like to still be able to get the position of the cursor, even if it's invisible.Possible?
  18. Maybe a bit more info about how to use? Also, I noticed you use a lot addEventHandler, for example, in the function Button:Create, you create 3 event handlers for each button, is it really necessary?
  19. Yes, hopefully it run perfectly (only clouds make some fps drops..) i7 920 4870 1Gb 3Gb of Dominator 1600 But this game doesn't require half of this to run smoothly at 1920*1080, I think.
  20. Yes, this does change the height of the hud, not the width, but changing the width with address 859520 bring a problem with the weapon icon which doesn't move along with the other HUD elements. But to move that icon horizontally, we can use address 866C84 Both addresses need to be changed to: (original_value * (4/3)) / (ScreenWidth/ScreenHeight) So it's also possible to scale the whole hud, for example to 75% of it's original size: 859520 = ( (original_value * (4/3)) / (ScreenWidth/ScreenHeight) ) * 0.75 859524 = original_value * 0.75 866C84 = ( (original_value * (4/3)) / (ScreenWidth/ScreenHeight) ) * 0.75 [attachment=0]mta-screen 2010-06-11 20-08-50.jpg[/attachment] But there is a problem with texts such as zone and car names.. they appear not centered but to the right... I'm currently searching addresses of positions and scales (or size) for all hud elements, so maybe there will be some new functions such as setPlayerHudComponentPos( player, component, x, y) and etc...
  21. Ok, after wasting a few hours with Cheat Engine, I THINK I've found the address, and which value to set to it. The address is 0x00859524, with original float value of 0.002232143 After few tests, I've concluded that this value need to be changed to: For 16/10 resolution: ( (16/10) * 0.002232143 ) / (4/3) = 0.0026785715 For 16/9 resolution: ( (16/9) * 0.002232143 ) / (4/3) = 0.0029761905 So.. a simple fix would be to set this address to ( (ScreenWidth/ScreenHeight) * 0.002232143 ) / (4/3) or simplified: (ScreenWidth/ScreenHeight) * 0.0016741072 I am not sure if that is the only adress to be changed, and also not sure if it will work for everyone... but it worked for me, in single player game. Please tell me what you think
  22. I would like to learn how.. Which program(s) do you use? tsearch? IDA?? lol
  23. Not for me. With widescreen enabled, the world isn't stretched but my hud still is, like in the upper part of the image. Game's resolution is 1920*1080 as it's my screen's native resolution. Talidan, do you know the memory addresses that need to be modified ?
  24. I would like this to be fixed if possible I've found some code for VC, unfortunately not for SA. I doubt it's of any use for you devs, anyway: http://squiddy.marway.org/gta/source/vcwidescreen.txt http://squiddy.marway.org/gta/screens/v ... eafter.jpg I would like to try doing it myself, but... I don't know much and my custom build won't run anyway.. I may try on a older working version I have.
×
×
  • Create New...