Geo
Members- 
                
Posts
21 - 
                
Joined
 - 
                
Last visited
 
Everything posted by Geo
- 
	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?
 - 
	Are any of these values assigned to a variable? t = {1001, 1086, 1025} or if they're: t = {a,b,c}
 - 
	
[Multi Game Mode] CnC War Enterprises [English|Multi]
Geo replied to CobraJ's topic in Servers to play on
Amazing man, kudos to your work. Sad that you gave up on MTA! - 
	Storing data in MySQL as a JSON string... I didn't thought of that, thank you so much!
 - 
	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!
 - 
	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
 - 
	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.
 - 
	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
 - 
	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!
 - 
	Thank you so much man!
 - 
	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.
 - 
	¿Eres / estás asociado con Dias?
 - 
	Yeah, I realized my mistake. Embarrasing!
 - 
	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?
 - 
	Hypothetical scenario. Say that I've a table, maybe something like: gang_zone = {} gang_zone[1] = {} gang_zone[2] = {} gang_zone[3] = {} gang_zone[1] = createColCuboid(123, 456, 789, 1012) gang_zone[2] = createColCuboid(934, 534, 135, 1941) gang_zone[3] = createColCuboid(913, 851, 153, 3913) Is there a way a single onColShapeHit listens for a element hit on all these areas at the same time?
 - 
	I didn't knew that -1 on dbPoll would make it so it waits until receives a response. I missed that from the wiki. Thanks!
 - 
	Hello, I don't know why, but my script is returning the data sent by my MySQL database as userdata type instead of string, this prevents me from being able to compare the data prompted by the user with the data in the Database. Log In server: function PlayerJoin() triggerClientEvent ("openLoginGUI", resourceRoot, true) end function sendData(userLogin, userPassword) outputServerLog("Data sent") local userLogin = userLogin:gsub("%\n", "") local userPassword = userPassword:gsub("%\n", "") outputServerLog(userLogin) local results = exports.sql:_Query('SELECT * FROM users WHERE playerAccount=? and playerPass=?', userLogin, userPassword) --local results = exports.sql:_Query('SELECT * FROM users') outputServerLog(type(results)) end addEvent("receiveDataFromClient", true) addEventHandler("receiveDataFromClient", resourceRoot, sendData) addCommandHandler("logintest", PlayerJoin) Log In Client: function login_panel() outputConsole("a a a") showCursor(true) login_box = guiCreateWindow(0.39, 0.29, 0.21, 0.43, "", true) guiWindowIsSizable(login_box, false) 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) end function click() if source == big_button then local user = guiGetText(user_input) local password = guiGetText(password_input) outputConsole(user) outputConsole(password) triggerServerEvent("receiveDataFromClient", resourceRoot, user, password) end end addEventHandler("onClientGUIClick", root, click) addEvent("openLoginGUI", true) addEventHandler("openLoginGUI", resourceRoot, login_panel) SQL Server Query Function: connection = dbConnect("mysql", "dbname=database;host=127.0.0.1;port=3306;","admin","admin") function _QueryResult(queryHandle) local results = dbPoll(queryHandle, 0) return results end function _Query( ... ) if connection then query = dbQuery(_QueryResult, connection, ...) return query else outputServerLog("DB: Tried to fetch query but failed.") return false end end
 - 
	From the wiki: ...This is useful for attaching 2D gui elements to parts of the world Can you simulate 3D in 2D GUI elements?
 - 
	The ped is safer without using that cover lmao
 - 
	Hey @IIYAMA thank you for such an honest answer. Would you be so kind to explain with more detail what you mean by different gamemode states? Excuse my ignorance, but I don't know jack about what you mean by this point. For the rest, thank you so much! I'll keep your answer in my mind, most importantly your third point, I think every developer has come through an inspiration phase that ultimately leads to demotivation, hopefully that wont be the case with me!
 - 
	Hello, I've been lurking for quite some time, thinking about learning Lua and scripting my own server. I've experience programming and I've been reading about Lua for a while, so I decided to ride on the quarantine and code something in these dark times. I've decided to start coding an RP gamemode from scratch. The thing is that I don't know where to start, I'm overwhelmed by ideas and I don't know what to execute first. What do you think every RP gamemode should rely on? What system would you code first to lay down the fundamentals? Also, if you've any tips that you want to share, please do!
 
