Jump to content

Pirulax

Discord Moderators
  • Posts

    403
  • Joined

  • Last visited

Everything posted by Pirulax

  1. It clearly says on the wiki page: So, no, it doesnt, I'll add the note on the wiki page, so everyone will notice it.
  2. You mean position. Yeah, so he said the same. Its just much faster to write something in OOP than in PP, and its even easier to read. (In case you dont use spaces everywhere, because that makes no sense, and you follow the Lua style guide.) An own set of functions, variables, and such are called a class. But to answer your question: As I said, variables are just memory references, they are basically pointers, that point to a memory block, whatever. So basically, its the same like using getLocalPlayer():getHealth() So it really doesnt matter if the pointer to the mem. block is in the 'source' variable, or 'driftyz' variable, it means really nothing to the Lua VM. Yes, the player needs to be defined, and it needs to be an element that has the METHOD you want to call. Otherwise, if its nil Lua would throw an error like: "Attempt to index a nil value" Or if the method in that class doesnt exists(for ex.: you want to call setPosition() on a texture element) "Attempt to call a method 'setPosition' (something goes here, but idk what)" And so on.
  3. It does, but which DXT compression is the best to use? Is it the 5 or 3 or 1? I would say its DXT1 or DXT5, but the problem with DXT1 is that is doesnt support alpha blending, but most of the time, I dont use it anyways.
  4. Yeah, I know that. I tough that he wants to disable a kind of texture(for ex.: >128*128)
  5. First of all, remove unnecessary expressions (== true, ~= false) like this: --// THis if getElementData(theRadar, "zombieProof") == true then end --// To this if getElementData(theRadar, "zombieProof") then end --// And this: if zomb ~= false then end --// To this if zomb then end Other than that, i cant help you, because i dont know how does that 'extrahealth' resource works.
  6. But @IIYAMA what textures is he talking about? I still dont understand.
  7. So, OOP is the shortand of object orientated programming. Actually, every variable in Lua is an object, because variables are just referencing to a value, and the variables do not actually hold these values, this is why for example, this works: local = {test = "test", [10] = 10} print(tbl.test, tbl[10])--> test, 10 local tbl2 = tbl print(tbl2.test, tbl2[10])--> This will output the same as the another print, but watch this: --// As i said, variables DO NOT hold values, they are just a reference to an object: tbl.test = "nottest" tbl[10] = 12 print(tbl.test, tbl[10])--> nottest, 12 print(tbl2.test, tbl2[10])--> nottest, 12 Run it on repl.it if you want to try it out. So, in OOP every object has its own class, and has its methods, variables. What is a method? player:getPosition() Here the player is the object, and getPosition() is the method. (the ':' indicates that its a method) And to answer on the question: Its more readable than procedural programming And its much faster to write(you dont need to write out getElementPosition() and then enter the localPlayer too, but just type localPlayer:getPosition()) Now rethink your question, because it makes no sense at all(the resource OOP part of it)
  8. That only changes CJ's model itself, and not the cloth models I think. So
  9. Is there any way to replace CJ cloth models? I've found a big C++ table of all modelids and their names in MTA, aswell a definition of the first and last cloth model id, but when i try to replace it, it just says it failed. But i can load the DFF.
  10. Maybe you could just make a simliper rectangular radar. I could help you with that.
  11. I'll want to do an encoder anyway, so if I'll finish it I'll post it here.
  12. You dont need to. The browser volume(MTA volume) is adjusted automatically. You I think you dont need to. But to answer the question: As of now there is no way to do that. (if im wrong correct me)
  13. Why do you want to get them?
  14. Thats so cheeky to sell a 10 line script that uses TEA+base64... Really.. It should be working.
  15. You dont need to take out the local variable(but its recommended, because of clearness of the code) Since the interpreter doesnt care if everything is in one line, you could just write in: local vehicle = getPedOccupiedVehicle(localPlayer);setElementVelocity(vehicle, 0, 0, 5) local vehicle = getPedOccupiedVehicle(localPlayer) setElementVelocity(vehicle, 0, 0, 5) Or maybe this(im not sure about this one, but try it): local vehicle = getPedOccupiedVehicle(localPlayer)setElementVelocity(vehicle, 0, 0, 5) But the best is what _Evo_ wrote:
  16. What u dont understand? Let me know, so I can explain it.
  17. Its still missing indentations. Btw, yeah, use this script piece: local soundsByVeh = {} function attachSoundToVehicle(vehicleElement, soundElement) attachElements(vehicleElement, soundElement) soundsByVeh[vehicleElement][soundElement] = soundElement end function getSoundsAttachedToVehicle(veh) return soundsByVeh[vehicleElement] end function removeAttachedSoundFromVehicle(veh, sound) soundsByVeh[vehicleElement][sound] = nil end
  18. Im my option: ITS TO FREAKING COOL!
  19. 2019-es verzió hogy létezik, amikor 2018 van most? Mellesleg, elirtad: engineSetModelLODDistance(806, 500) Illetve *modell* Ja, és felesleges külön változókat létrehozni, úgyem használod őket sehol: outputChatBox ("Garázs betöltve") if engineImportTXD(engineLoadTXD ("model/garazs.txd", true),806) and engineReplaceModel(engineLoadDFF ("model/garazs.DFF", 0),806) and engineReplaceCOL(engineLoadCOL ("model/garazs.col"),806) then outputChatBox ("Garázs betöltve") else outputChatBox ("Sikertelen garázs betöltés") end
×
×
  • Create New...