Jump to content

Geo

Members
  • Posts

    21
  • Joined

  • Last visited

Recent Profile Visitors

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

Geo's Achievements

Civilian

Civilian (7/54)

9

Reputation

  1. Would you be able to post your answer so people that encounter your problem in the future be able to use this as reference / solution?
  2. Are any of these values assigned to a variable? t = {1001, 1086, 1025} or if they're: t = {a,b,c}
  3. Amazing man, kudos to your work. Sad that you gave up on MTA!
  4. Storing data in MySQL as a JSON string... I didn't thought of that, thank you so much!
  5. Hello guys, I've a concern I think you'd be able to clarify. In the gamemode I'm scripting, I created an user register system. Within this system users can create characters, now, the thing is, because there's a ton of data I wanted character tables to store, I decided the best course of action would be saving all this character data locally instead of MySQL, here's where my problem comes in. Is it a bad practice to store all the character data in a single JSON file? This certainly feels dangerous to me. On the other hand, I could create a JSON file for each character created, but, wouldn't coding a script so it finds X file in a bunch of files and retrieves its data be slow? Please help!
  6. What would be an example of doing this in Lua? What I'm doing is setting data to an created object element in order to act accordingly when that object is used by players
  7. Hello guys, I'm writing a gamemode and I'm using a lot of setElementData in order to work with the functionality of the items in my script. The synchronization between server and client is disabled, all the element data is handled server side. I was wondering, is this a bad practice? Since I've read using synchronization takes a toll on server performance, I was wondering how much of a toll would be without synchronization.
  8. This is genius. I actually only needed to get the random X and Y from the colShape in order to determine the position for a new object. function getElementObjectCoords() local zones = exports.zones:createZone() local width = zones[1]["width"] local depth = zones[1]["depth"] local X = zones[1]["coordsX"] local Y = zones[1]["coordsY"] local Z = zones[1]["coordsZ"] local ranX = X + math.random(width) local ranY = Y + math.random(depth) return ranX, ranY, Z end
  9. So I've the following Cuboid: createColCuboid(-2846.07104, -1545.08484, 137.68427, 64.902099609375, 53.124267578125, 4.56259765625) What I'd like to do (But have no idea on how to do it, or is it even possible) it's to make a function that gets a random coordinate from the LOWEST point of the cuboid. This is in order to create an object in a random position inside the cuboid. It has to be in the lowest point of the cuboid since the object shouldn't be floating in the air, but on top of the ground. The cuboid data is stored in a cube named table, where its coords, width, depth and height are stored in. If it can't be done with the Cuboid object, maybe I can use this data to code the previous mentioned function? EDIT = I'm guessing it involves some math, which is not my strong suit. If you know how to solve this, please don't mind sharing the mathematics fundamentals you used in order to solve this problem. Thank you so much!
  10. Yo diría que uno de los fundamentos más importantes en la programación es conocer bien los atributos de la data con la cual estás trabajando. El tipo de data, a donde la vas a pasar, como vas a formatear esa data. Yo comence hace poco a estudiar Lua, y el causante de la mayoria de los errores que me encuentro es que no estoy inicializando o utilizando data de la manera en que debería. Lua es extremadamente versatil, pero tal vez te sea dificil reconocer esa versatilidad si no te manejas en otro lenguaje. Mencionas que estás aprendiendo Python, ¡Eso es excelente! Entiendo que pueda aburrir pasar mucho tiempo programando codigo que promptea a una consola, así que te recomiendo una forma muy buena y entretenida de aprender a programar: Data Scraping. Haciendo Data Scraping vas a estar en contacto con diferentes tipos de data, aprenderas los fundamentos y la naturaleza de estas estando constantemente en contacto con ellas. Además de eso, el Data Scraping es divertido y se siente muchísimo más la recompensa cuando terminas un codigo, además, quien quita que te sea util ese conocimiento a la hora de que tengas un servidor de MTA. Si te interesa eso, busca que es la Data Scraping, Selenium y Scrapy (Los dos ultimos son modulos de Python, te recomiendo que comiences por Selenium) EDIT: No te recomiendo que le hagas caso a cosas como ''Si te aburre no es lo tuyo'' porque es más complicado que eso. Yo amo la programación, y hay dias en que no puedo pasar cinco minutos en frente de un editor de texto. Recuerda que somos humanos y nuestro cerebro es una vaina extremadamente loca y profunda. Los primeros días es una cagada, pero sigue golpeandote contra la pared del aburrimiento, fuerzate a hacer lo que debes hacer y mas temprano que tarde te darás cuenta que disfrutas mucho más programar.
  11. Yeah, I realized my mistake. Embarrasing!
  12. Pretty simple question, but got me thinking a lot. Creating a GUI with tables: gui_elements = {} gui_elements["login_box"] = guiCreateWindow(0.39, 0.29, 0.21, 0.43, "", true) gui_elements["user_input"] = guiCreateMemo(0.16, 0.15, 0.66, 0.13, "", true, login_box) gui_elements["password_input"] = guiCreateMemo(0.16, 0.30, 0.66, 0.13, "", true, login_box) gui_elements["big_button"] = guiCreateButton(0.17, 0.47, 0.43, 0.11, "", true, login_box) gui_elements["small_button"] = guiCreateButton(0.68, 0.47, 0.15, 0.12, "", true, login_box) Creates a different sized GUI than like this: login_box = guiCreateWindow(0.39, 0.29, 0.21, 0.43, "", true) user_input = guiCreateMemo(0.16, 0.15, 0.66, 0.13, "", true, login_box) password_input = guiCreateMemo(0.16, 0.30, 0.66, 0.13, "", true, login_box) big_button = guiCreateButton(0.17, 0.47, 0.43, 0.11, "", true, login_box) small_button = guiCreateButton(0.68, 0.47, 0.15, 0.12, "", true, login_box) Why is this?
×
×
  • Create New...