Jump to content

RottenFlesh

Members
  • Posts

    189
  • Joined

  • Last visited

2 Followers

About RottenFlesh

  • Birthday 20/03/1995

Details

  • Location
    El Salvador

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

RottenFlesh's Achievements

Mark

Mark (16/54)

0

Reputation

  1. Just set the update option to download the lastest nightly versions. There is where the bugfixes are.
  2. Wow this is awesome! Having to upload and download a compiled file from the webpage is really annoying. So thanks! This is very useful! Just a question: With this method the files are extra-obfuscated? Or just normal compiled? BTW: I get this warning in the console of Sublime: WARN Without -s or -e, compiled files contains debug information and can be more easily decompiled (script.lua)
  3. F-uck! Odio cuando tengo una idea y alguien mas lo ha hecho ya https://community.multitheftauto.com/index.php?p=resources&s=details&id=8303
  4. He estado haciendo esto recientemente: matrices + dxDrawMaterialLine3D = genialidad!
  5. Gracias por tu recomendación! Como has podido observar, los tutoriales son bastante sencillos, están orientados mas que nada hacia las personas que apenas comienzan, por eso es que me centro en temas bastante específicos, así no esta muy saturada la información. Ahorita apenas me voy adentrando en explicar las estructuras de control, los siguientes serán sobre loops y luego empezare a hablar sobre las librerías que trae lua.
  6. That will not work, as onClientPlayerQuit is only triggered on remote clients. You have to make this system server side, and the use triggerServerEvent and triggerClientEvent to get the data client-side.
  7. Una reacción rápida promedio de un humano dura un poco mas de 200 milisegundos. Acá estamos hablando de apenas decenas de milisegundos, esos son tiempos sumamente rápidos. Entiendo que por ejemplo en un gamemode race es realmente necesaria mucha rapidez de procesamiento (que el mapa vaya cargando mas lento de lo que conduces es fatal!). Pero en otros tipos de gamemode no veo donde esta la importancia de ahorrarse una cantidad tan mínima. http://www.humanbenchmark.com/tests/reactiontime/stats.php
  8. Bueno, yo también hice mis pruebas. Aquí están los resultados: Procedimental: Metodo: Resultados en 10 pruebas: OOP: por cierto, oop tampoco existe en español, tendrías que decir POO. Metodo: Resultados en 10 pruebas: Conclusión: Lo dejo a decisión de cada quien, por mi parte yo voy a seguir usando OOP.
  9. Nonono! It is totally possible, you just have to implement it yourself. Read this: http://lua-users.org/wiki/ObjectOrientationTutorial This is how you can implement OOP by yourself, with classes and inheritance and everything.
  10. Y la fuente de esta información la sacaste de donde? *De lo siguiente no estoy seguro, así que no te lo tomes enserio: Mira, yo he leído los archivos del código fuente donde esta programado el OOP, y esos archivos simplemente hacen referencia a las funciones normales. Ademas, que no es C mas rápido que lua? Si es asi, entonces es mas rápido hacer todos esos cálculos en C, que llamar la función getElementMatrix y hacer los cálculos tu mismo, ademas que de igual forma tiene que hacer varios cálculos internamente en MTA, no es mejor que directamente se encargue de todo? Claro, en este contexto especifico de las matrices... Acá esta el código fuente del que te hablaba: OOP client-side: https://code.google.com/p/mtasa-blue/source/browse/trunk/MTA10/mods/shared_logic/lua/CLuaMain.cpp OOP server-side: https://code.google.com/p/mtasa-blue/source/browse/trunk/MTA10_Server/mods/deathmatch/logic/lua/CLuaMain.cpp Nomas dale al Ctrl+F y busca la función que quieras. Ahí están programadas las referencias a las funciones de las matrices y los vectores también. Si quieres ponemos esto a prueba, de OOP vs el tradicional procedural. Hacemos múltiples pruebas, les sacamos promedio y vemos quien tiene la razón. Nos ponemos de acuerdo en que métodos vamos a usar para hacer la prueba y lo dejamos todo claro desde el principio sin entrar a discusiones sin sentido y sin fundamento. Que te parece?
  11. Aaaah bueno, esta bien entonces. Solo como un dato interesante, a quien le interese saber... Para obtener la posición enfrente del player en MTA 1.4, puedes hacer esto: local pos_enfrente = player.position + player.matrix.forward * 2 Con eso obtienes la posición a dos metros de distancia, enfrente del jugador, no importa hacia adonde este viendo. Luego para usarlo nomas haces esto: createVehicle(modelo, pos_enfrente) -- Sí, las funciones como estas ya aceptan vectores, ya no es necesario escribir las tres coordenadas. O si prefieres hacerlo en OOP, lo haces así: Vehicle.create(modelo, pos_enfrente) -- Incluso se puede hacer sin el ".create", solo con Vehicle(cosas), pero no estoy seguro por que no lo he probado aún.
  12. The children table has an index starting with zero, you have to loop it using pairs, not ipairs. As ipairs always start from index one, therefore, missing the first node in the child table.
  13. If you have a player variable, you can do something like this: function command(player) player.name = "something" outputChatBox(player.name) player.money = 100 end addCommandHandler("blah", command) But they are predefined by MTA, you can not create your own, unless you make your own implementation of OOP in lua using tables and metatables. We are slowly documenting the OOP syntax in wiki. i've already documented almost every server-side player functions by myself. https://wiki.multitheftauto.com/wiki/Server_Scripting_Functions#Player_functions There, you will see something like this: [b]OOP Syntax[/b] [b]Method[/b]: player:getName() [b]Variable:[/b] .name [b]Pair:[/b] setPlayerName It means you can do things like this: function some_random_function(player) local name = player:getName() -- element -> "player"; method -> ":getName()" local name = player.name -- ".name" is just short for getPlayerName() -- And the pair function is used when you have a variable like the one above and you set a value to it. player.name = "something" -- in this case you are not calling getPlayerName(), but setPlayerName() is used instead. end There is also methods and variables that are declared under some object Class. Like this: function some_other_random_function() Player.getRandom() -- "Player", is a class that contains all player methods and variables, and ".getRandom()" is one of those methods. Player.random -- This is just a short form of the above. Both valid. end I hope you understand what i said, English is not my native language
×
×
  • Create New...