Jump to content

egorkoltyshev

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by egorkoltyshev

  1. Thanks. This is exactly what I did as a temporary solution. But I need to compare the player's login case sensitive. Unfortunately, I did not find a function for this. if(getPlayerCount() > 1) then for _, p in pairs(getElementsByType("Player")) do if(hasElementData(p, "isLogged")) then if(string.lower(login) == string.lower(getElementData(p, "login"))) then outputChatBox("The player under this login is on the server.", source) return end end end end
  2. I do authorization, I made a check so that two players with the same login could not log in at the same time. How to check if the case of the login entered in the game matches the login in the database? "test" (game) - "test" (base) = the player will not be skipped, since the player with this login is already in the game. "Test" (game) - "test" (base) = will skip the player and there will be 2 players in the game under one account. addEvent('playerLogged', true) addEventHandler('playerLogged', root, function(login, password) local check = exports.mysql:mysql_query_single("SELECT * FROM `players` WHERE `login` = ?", login) for _, p in pairs(getElementsByType("Player")) do if(getElementData(p, "login") == login) then outputChatBox("The player under this login is on the server.", source) return end end .....
  3. I'm trying to develop my own server, and I ran into a problem that if you update the text containing Russian characters from the game, then it will not be displayed correctly in the database, and if vice versa, then question marks in the game. What can be done about it? Is there a way to store both English and Russian text without any problems, and edit both from the game and directly from the database. The encoding in the database is utf8_general_ci.
  4. Hello! A few questions about loading data from the database, in my case, for example, transport. But by analogy, in the future I plan to load all the other information from the database. The code I have written so far: 1. Am I creating the vehicle in the vehicles table correctly and storing the data in elementData? Or should we also use the Vehicle[v.id]['x'] = v.x table to store the data? vehicle[v.id] = {} vehicle[v.id]['x'] = v.x 2. Will there be any problems and how convenient it is if I use its id from the database as the transport number and not as it is written in the table 1,2,3..n for _, v in pairs(result) do vehicle[v.id] = createVehicle(v.model, v.x, v.y, v.z) or for i, v in pairs(result) do vehicle[i] = createVehicle(v.model, v.x, v.y, v.z) Sorry for my English.
×
×
  • Create New...