Jump to content

50p

Retired Staff
  • Posts

    2,973
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by 50p

  1. You can also load different txds depending on situation, position, etc. So, you can load 1 txd for the model if you are close to 1 shop but load different txd if you're close to the other shop. This method will only work if the 2 same models are not visible at the same time.
  2. If you still want that in 1 line which I would unless you need to use current cans number more than once, you need to pay close attention to brackets: setElementData ( source, "cans", ( tonumber( getElementData(source, "cans" ) ) or 0 ) + cans, false )
  3. Your code is wrong in many aspects. You are not experienced enough to post such simple scripts without testing and confusing people. Please don't post incorrect code to confuse people even more.
  4. Stop arguing or solve the problems via PM. Keep the forum clean please. Question has been answered so no need to go offtopic.
  5. You need to understand, you can apply only 1 txd ("texture archive") to specific model. If you single model uses multiple "textures" then they need to be put into 1 "texture archive" (txd file). If you open a txd file with TXD Workshop or G-TXD, you will find that it contain more than 1 texture. Most of the txd files hold more than 1 texture (especially environment and vehicles) but not all of them.
  6. If a model uses more than 1 texture then all the textures must be inside 1 .txd file. In this case replacing 1 txd file will apply all the textures from this file. AFAIK you can't replace clothes models but you can replace other ped models.
  7. You can try this (I haven't tested it): function isPointInTriangle( x,y, x1,y1, x2,y2, x3,y3 ) if sign( x,y, x1,y1, x2,y2 ) < 0 or sign( x,y, x2,y2, x3,y3 ) < 0 or sign( x,y, x3,y3, x1,y1 ) < 0 then return false; end return true; end function sign( x1,y1, x2,y2, x3,y3) return (x1 - x3) * (y2 - y3) - (x2 - x3) * (y1 - y3); end
  8. https://wiki.multitheftauto.com/wiki/GetAccount read the example.
  9. I don't understand your question I'm afraid. The latest build 4722 if from 5/12/2012 (for some reason the first post doesn't show the newest date). It includes all functions from wiki even the functions available from future MTA release (including nightly builds). Functions file was last updated on 2/12/2012 (exactly 1 month ago).
  10. To my knowledge I don't think there is a way to do it. AFAIK, you can predict RPM and torque but you will never get accurate result. Say you can get amount of gears specified for a car with handling functions, same for max velocity and divide the velocity by amount of gears, that would give you average speed on each gear (not every gear is the same but for the sake of simplicity you can presume they are). Then you can get vehicle's current gear and torque (velocity % (average speed per gear)). Remember, it's GTA and even calculated speed seem way too fast when driving 50mph in-game compared to speed in real life.
  11. You stream objects up to 200 units by default. Some objects aren't even visible at 200 units away from you. You have to move yourself closer to the player who you want to spectate to stream the objects. You can attach yourself to the player and set your alpha to 0 so they won't see you.
  12. It will get laggers when you have over 10.000 or 5.000 lines. So you can't make your own library? 1) What do you mean by "it will get laggers"? 2) Do you know how much time it'd take to make my own syntax highlighting lib? People make them as separate projects and they spend as much time on them as I do on this. EDIT: After searching for days, I found .NET wrapper for Scintilla syntax highlighter which I know from 3DS MAX Script Editor and apparently it's used by Notepad++ as well, so it's just a matter of setting it up properly.
  13. Use cancelEvent instead of removePedFromVehicle, also I'd suggest using 1 function and couple of "if"/"elseif" statements.
  14. For the author's request the topic is locked.
  15. I know you can lock your DFF files in 3DS Max before you export them but it doesn't stop people from importing them back to 3DS because all the "lock" does is add 1 byte at specific offset which can be changed manually to "unlock" the file but not everyone knows this. I'm sure you don't want people to use your scripts, deleting files after they quit would be one method but this doesn't stop them from Alt+Tab the game and copy the files before they quit. Since the scripts are loaded into memory you can delete them right after they're loaded. That's one way of doing it. As you said, you can also encrypt them with Luac and add the encrypted files to meta.xml instead of the original files which is much easier. To protect your models (dff) and textures (txd) you can use file functions server-side to read the files and then send the content of the file to client as a string when needed. Once they are sent you can then create temporary files client-side which can then be loaded and deleted straight away. I haven't tried that but I'm pretty sure it should work. You could do this for all the files, even Lua script files.
  16. 50p

    For all scripters.

    Do not trust people with so little professionalism. There is so little description that nobody knows what it is and what it does.
  17. What do you mean by "custom map"? Do you mean a completely new map with custom 3D models? If so, then you need a 3D application like 3DS Max with KAM's script which will let you export models to .dff and .col. You can also use my script which will export the models, generate .map file based on the 3D scene and a Lua script that will replace the game models for you. - http://www.gtagarage.com/mods/show.php?id=9172 - viewtopic.php?f=108&t=27406
  18. As far as I know there is no event for objects attached to other elements since they don't have collision when attached. I might be wrong. You can try: https://wiki.multitheftauto.com/wiki/OnC ... WeaponFire and check if the hitElement is the attached object or vehicle.
  19. You can debug the event and check the "bodypart". I'm not sure if this will be part of the ped's or vehicle's body. If it works with vehicles too then you don't need anything else but if it works with peds only then you'll need to calculate angle of where you got hit with the collisionX/Y/Z and current vehicle's position. You can use findRotation to help you a little. https://wiki.multitheftauto.com/wiki/FindRotation
  20. https://wiki.multitheftauto.com/wiki/OnC ... eCollision
  21. That's called multi-line comment. I spoke to the author of the syntax highlighter and he sent me a fix for this but it still doesn't seem to work properly I'll have to find a way to fix it myself or use different syntax highlighter library.
  22. You didn't understand the question. Threule wants to display 2 different models of 2 vehicles of the same model ID for 1 client which is not possible. You can change textures of the same model but different elements though. You can have the same model IDs with different textures for 1 client. https://wiki.multitheftauto.com/wiki/Eng ... rldTexture
  23. But he wants to see his own as 1 and his friend as another one. 2 separate models for same client which as far as I know is not possible.
×
×
  • Create New...