Jump to content

50p

Retired Staff
  • Posts

    2,973
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by 50p

  1. Why don't you use speedometer resource? https://community.multitheftauto.com/index.html?p ... tails&id=5 I wanted to update it for 1.0 with use of DX functions. I also wanted to make the speedometer fully customizable, so that every part of speedometer is separate (like, background, needle, etc.) I will update it when I finish what I'm currently programming.
  2. You're welcome. Any problems, post here, someone will always try to help you.
  3. 50p

    Modifying scripts

    "Loading of failed" usually pops up when resource has problem with meta.xml or there is no meta.xml at all. If your resource is zipped but there is no meta.xml in the root then you will get that message. If you're modifying a resource just unzip that resource and use the folder instead of the zip because if MTA finds a folder it is treated as resource and if there is zip with the same name as the folder then zip resource is ignored.
  4. 50p

    Need help

    If you attach a function to a button without the false then that function will be triggered even if you click other GUI (windows, buttons, images, etc.) but if you use false, then this function will be called only if source == this (In other words, if "attachedTo" element (the button in this case) is equal to source (clicked gui element)).
  5. You have to reset the tickStart every time player hits the start collision shape. In your code I don't see any line responsible for that. trackStart seems to be a function that is called every time player start the track, but you never reset the tickStart, don't wonder why it's stacking up. Also, in finish function you have variable called "time" which is also a function that you're meant to use to reset the time. When you make a "global" variable with the same name as a function, the function will no longer exist and never used.
  6. Post some code and we may find out what's wrong. You need to have that tickStart "global" (without local when declaring it or with local but at the top of the file) so when you assign new value to that variable the old one gets deleted. If you have tickStart (as global) and a new variable in a function than things gets messed up and the global tickStart wouldn't be even used in that function... As I said, post some code and we'll see what's wrong.
  7. To get results like 20.14 you divide the 20147 by 1000 (1 sec == 1000ms.) To get rid of the last digit you can use string.format() function, like: time = RUN_TIME / 1000; -- eg. 20147 / 1000 numberStr = string.format( "%.2f", time ); -- 20.15 -- notice 5, it round up the last digit (7 >= 5) Also, if you made the script then you should know where the player starts the run.
  8. 50p

    Need help

    DaK, 2 things: - where is takePlayerMoney? - don't forget about false as the last parameter in addEventHandler call if you use gui elements as attachedTo (2nd parameter) Also, I don't see a point in making a variable which is only used once (the money var is used in the if statement only).
  9. I would recommend using examples off the wiki and the scripts which are already made. Use this as well: https://community.multitheftauto.com/index.html?p=resources
  10. No, it's not because it was a bit laggy when there was more players online... but then it was fixed to only see a certain number of peds in a rage. Then it disappeared and is not available to download, not sure if it was actually available at all.
  11. Come one people. MTA is made to play and enjoy the time playing it, not to browse internet. This is totally useless to make a web browser in a game... It's like making video player in Microsoft Word
  12. That's what you were suggested to do. Good luck.
  13. The same way you freeze it but use false instead of true.
  14. 50p

    Car respawn

    Because that was a question a guy asked... If you have some knowledge about scripting in Lua than you can modify it easily. Every single post of yours doesn't show any skills you have but good luck... BTW, STOP POSTING SHIT REPLIES IF YOU CAN'T EVEN HELP YOURSELF!
  15. 50p

    After player die

    If you're using some house system it should deal with such things like spawning at the house... If it doesn't than it's not a good house "system" and you'll have to modify it to make it possible to spawn at the house... How would you know the position to spawn? If you know the house coords than these coords should be saved in a database so that when player comes back he spawns at that location.
  16. GTA must have such variable... When vehicle changes gear you can see the hood going down, which is caused by "releasing" acceleration pedal, you're not releasing it but the engine itself does. The Camera Hack mod has speedometer with 2 gauges. One shows the speed of the vehicle and another one shows RPM (revolutions per minute, engine's speed). You can't calculate them because every vehicle has different gears. Maybe certain speed has certain gear. eg. when you're at 100mph, that's for instance 3rd gear and every vehicle has the same stats... but that wouldn't be realistic and therefore not in GTA... But someone could check that and confirm that I'm not correct
  17. This is an issue with sending large numbers to client. I had the same problem with my bank resource which doesn't always show correct amount of money you have on your account because sending huge numbers to client fails. This is from changelog of the bank resource:
  18. 50p

    Car respawn

    I posted code responsible for respawn of vehicles in map file looong time ago... https://forum.multitheftauto.com/viewtop ... 70#p280170 (onVehicleExplode) This code will destroy vehicles which were created with createVehicle and vehicles that are not created with your resource. You can delete some of "if" statements to make it work as you want.
  19. Why it doesn't say "attempt to call global 'SetElementHealth' (a nil value)"? Lua, as many other programming/scripting languages is case-sensitive. SetElementHealth is not same as setElementHealth. All MTA functions start with lower case characters.
  20. There is no better solution than using IDs.
  21. To be honest, I don't understand your questions...
  22. 50p

    Player menu

    There is too much to code to do it for you just like that, especially if you're "fresh user"... You probably downloaded .lua files with those menus because you joined that server and all GUI functionality is client-sided... If the server you joined doesn't use .lua but a compiled version of the file, you will not get source code because you can't even script, yet. Learn to script and make those menus yourself. Here, http://development.mtasa.com/index.php?title=Main_Page this is your new bible. BTW, I'll give you an advice. Do not use mad "smilies" because nobody will even try to help you.
  23. DFFs, TXDs, COLs and images must be downloaded by client to make a use of them, so... you have to make the script client-side. Add type="client" as an attribute to the file in meta.xml. Example: <script src="load_custom_objects.lua" type="client" /> Client-side events have different names.. basically they have "onClient" as prefix and server events just "on". To use onResourceStart client-side you have to use onClientResourceStart, simple, huh? Also, don't use getRootElement when adding onClientResourceStart/onResourceStart, unless you want that function to be called every time any resource start. Use getResourceRootElement( getThisResource( ) ) instead. Example: addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource( ) ), mapLoad )
  24. Or you can do something like this: longXcoord = 1234.567890; x = tonumber( string.format( "%.f2", longXcoord ) );
×
×
  • Create New...