Jump to content

Ayanami

Members
  • Posts

    7
  • Joined

  • Last visited

Ayanami's Achievements

Newbie

Newbie (4/54)

0

Reputation

  1. That was helpful, thanks a lot.
  2. Good point, but I commented the "free" command out with the same result I am not quite sure whether the "free" command just frees up some memory leftovers, or if it actually erases the content of my variable...as I said these are basic things, but I cannot find a documentation anywhere Concerning fetch_assoc - I'll try that tomorrow. Thanks in advance...
  3. Hello folks, I've got an MTA server set up along with a MySQL server. The database contains a table named Account, where the user data is stored (e.g. Username, Password...). Next, my login requests the user to enter his username and his password. Then it tries to fetch the correct password of the respective username from the database in order to compare it with the password that has been entered. Unfortunately, although the database connection is established, the query always returns nil: (In the code snippet below, this is line 11.) I would really like to do more research on this matter myself since it's kind of a basic problem; but I was unable to find much documentation or even better a tutorial on the mysql "add-in". Any suggestions on the problem or documentation references would be greatly appreciated function evaluateLogin(enteredUsername, enteredPassword) outputChatBox("Login auswerten: " .. enteredUsername .. "//" .. enteredPassword) handler = mysql_connect("localhost", "[color=#FF8000]<myUser>[/color]", "[color=#FF8000]<myPwd>[/color]", "mta") sqlresult = mysql_query(handler, "SELECT Password from Account WHERE Username=" .. enteredUsername) if sqlresult then mysql_free_result(sqlresult) end result = mysql_fetch_field(sqlresult) outputChatBox(result[0]) end
  4. Really great job! One thing I ran into though: Window name: wndLogin Created code (not working): guiWindowSetSizable(gui["wndLogin"], false) Should be (I guess): guiWindowSetSizable(gui["_root"], false) Furthermore, the size of some elements is not very accurate in the actual MTA dialog compared to the draft in QT. But one can definitely live with that, and your tool is still a wonderful help and time-saver!
  5. To put it shorlty, I try to create some kind of Ped creator / editor. Since my programming knowledge derives not from Lua but from other major languages which are a little different, my first approach was to store all Ped data into rather complex arrays (e.g. pedtable[3]["firstname"] would return the first name of Ped with my ID 3). But now I must admit that just attaching the data to the respective Ped with SetElementData ist probably the far better solution. I've got a couple of other variables to store and eventually transfer to client scripts though (e.g. I also work on a possibilty to define walking routes for Peds, which are atm also stored in an array in the form of routetable[4][12]["X"] = Route 4, Checkpoint 12, X coordinate. Since multiple Peds should be able to use the same route, I do not want to attach the route to a certain Ped. But I'll hopefully come up with a solution for that... Thanks for your input again.
  6. This hurts a little. I guess then I just dump all data to the Console element and hope, no resource ever needs it being restarted. Though this makes it necessary that every function (server and client) needs to do a ReadData() as a first step and a WriteData() when finished. Still, it's...messy @_@ Anyways, thanks for the quick and enlightening response
  7. Hello folks, I have an issue with the validity range of variables. When I create a global variable inside a server script and then try to access / output it within a client script, it's always nil. Unfortunately I couldn't find any proper documentation on this, so I am asking you: Is that the normal behaviour of a global variable? If so, how to transfer it to the client side anyways? I have weird approaches in my mind about setElementData("console", ...), but I do not really believe that this is how the problem is to be fixed the best way. Thanks for your assistance in advance.
×
×
  • Create New...