-
Posts
48 -
Joined
-
Last visited
Everything posted by GodOfPenguins
-
Change "player" in argument to "thePlayer" from redirectPlayer function
-
Oops. function Call(Client, Command, Username, Password) local query = dbQuery(Connection, "SELECT * FROM users WHERE username = '"..Username.."' AND password = '"..Password.."';") local result, num_rows = dbPoll(query, -1) if num_rows > 0 then -- Match found success for row, rowData in ipairs(result) do -- rowData['column name'] outputChatBox(rowData['username']) outputChatBox(rowData['password']) end end end
-
function Call(Client, Command, Username, Password) local query = dbQuery(Connection, "SELECT * FROM users WHERE username = '"..Username.."' AND password = '"..Password.."';") local result = dbPoll(query, -1) if result > 0 then -- Match found success for row, rowData in ipairs(result) do -- rowData['column name'] outputChatBox(rowData['username']) outputChatBox(rowData['password']) end end end
-
function Call(Client, Command, Username, Password) local query = dbQuery(Connection, "SELECT `username`, `password` FROM users WHERE username = '"..Username.."' AND password = '"..Password.."';") local result = dbPoll(query, -1) if result > 0 then -- Match found success end end
-
[Question] How can I add Music to Roleplay Server
GodOfPenguins replied to FromMars's topic in Scripting
function loginPanel() sound = playSound("sounds/music.mp3", true) -- client code of login panel end addEventHandler("onClientResourceStart", getRootElement(), loginPanel) -- function that triggers upon successful authorization function destroyLoginPanel() stopSound(sound) -- cliend code of success login end https://wiki.multitheftauto.com/wiki/PlaySound https://wiki.multitheftauto.com/wiki/StopSound- 4 replies
-
- loginpanel
- login
-
(and 1 more)
Tagged with:
-
Sublime Text 3 + 50p (snippets) package
-
Can I somehow return the font from 2.78?
-
Did for my server, but now I decided to tackle another idea. So I decided to share it. In the archive is a table in which there are 893 zones throughout the map and the owner's column (Everywhere is "Citizen") and a column with the names of the zones (in Russian). ALMOST perfectly smooth. Download: https://community.multitheftauto.com/index.php?p=resources&s=details&id=14656 Screenshot:
-
I DONT REMEMBER MY PASSWORD
GodOfPenguins replied to Basooka's topic in Site/Forum/Discord/Mantis/Wiki related
Write to the server administrator -
Has already
-
Так и есть. Поменял, проблема исправлена, благодарю.
-
Aldeady no. Thanks for the help. Before that I used getRootElement(), but now I understood the difference
-
Only for create GUI: addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() fadeCamera(true) setCameraMatrix(150, 0, 250) showCursor(true) authGUI.loginWindow = exports.dgs:dgsDxCreateWindow(0.74, 0.33, 0.25, 0.35, "Авторизация", true, 0xFFFFFFFF, 25, nil, 0xC8141414, nil, 0x96141414, 5, true) exports.dgs:dgsDxWindowSetMovable(authGUI.loginWindow, false) exports.dgs:dgsDxWindowSetSizable(authGUI.loginWindow, false) --guiSetAlpha(authGUI.loginWindow, 0.80) authGUI.edit[1] = exports.dgs:dgsDxCreateEdit(0.04, 0.13, 0.93, 0.09, "Имя_Фамилия", true, authGUI.loginWindow) --exports.dgs:dgsDxEditSetMaxLength(authGUI.edit[1], 32) authGUI.edit[2] = exports.dgs:dgsDxCreateEdit(0.04, 0.26, 0.93, 0.08, "Пароль", true, authGUI.loginWindow) --exports.dgs:dgsDxEditSetMaxLength(authGUI.edit[2], 32) authGUI.button[1] = exports.dgs:dgsDxCreateButton(0.26, 0.41, 0.47, 0.18, "Войти", true, authGUI.loginWindow) --exports.dgs:dgsDxGUISetFont(authGUI.button[1], "default-bold-small") authGUI.button[2] = exports.dgs:dgsDxCreateButton(0.26, 0.74, 0.47, 0.18, "Создать аккаунт", true, authGUI.loginWindow) --exports.dgs:dgsDxGUISetFont(authGUI.button[2], "default-bold-small") addEventHandler("onClientDgsDxMouseClick", getRootElement(), function() if source == authGUI.edit[1] then exports.dgs:dgsDxGUISetText(authGUI.edit[1], "") elseif source == authGUI.edit[2] then exports.dgs:dgsDxGUISetText(authGUI.edit[2], "") --guiEditSetMasked(authGUI.edit[2], true) elseif source == authGUI.button[1] then local name, pass = exports.dgs:dgsDxGUIGetText(authGUI.edit[1]), exports.dgs:dgsDxGUIGetText(authGUI.edit[2]) if (name == "") or (pass == "") then outputChatBox("Не заполнены данные для входа!") else triggerServerEvent("PlayerLogin", getLocalPlayer(), name, pass) end elseif source == authGUI.button[2] then destroyElement(authGUI.loginWindow) authGUI.staticimage[1] = exports.dgs:dgsDxCreateImage(0.55, 0.22, 0.45, 0.71, "img/zayva.png", true) authGUI.edit[3] = exports.dgs:dgsDxCreateEdit(0.12, 0.29, 0.24, 0.03, "", true, authGUI.staticimage[1]) exports.dgs:dgsDxGUISetFont(authGUI.edit[3], "avalon") authGUI.edit[4] = exports.dgs:dgsDxCreateEdit(0.18, 0.54, 0.25, 0.02, "", true, authGUI.staticimage[1]) authGUI.radiobutton[1] = exports.dgs:dgsDxCreateRadioButton(0.19, 0.63, 0.03, 0.02, "", true, authGUI.staticimage[1]) exports.dgs:dgsDxRadioButtonSetSelected(authGUI.radiobutton[1], true) authGUI.radiobutton[2] = exports.dgs:dgsDxCreateRadioButton(0.32, 0.63, 0.03, 0.02, "", true, authGUI.staticimage[1]) authGUI.button[3] = exports.dgs:dgxDxCreateButton(0.15, 0.74, 0.30, 0.15, "Подписать", true, authGUI.staticimage[1]) --guiSetFont(authGUI.button[3], "default-bold-small") addEventHandler("onClientDgsDxMouseClick", getRootElement(), function() if source == authGUI.button[3] then local name, pass, serial = exports.dgs:dgsDxGUIGetText(authGUI.edit[3]), exports.dgs:dgsDxGUIGetText(authGUI.edit[4]), getPlayerSerial() if (exports.dgs:dgsDxRadioButtonGetSelected(authGUI.radiobutton[1])) then sex = 1 outputDebugString(sex) elseif (exports.dgs:dgsDxRadioButtonGetSelected(authGUI.radiobutton[2])) then sex = 2 outputDebugString(sex) end if (name == "") or (pass == "") or (sex == nil) then outputChatBox("Не все поля заполнены!") else triggerServerEvent("PlayerRegistration", getLocalPlayer(), name, pass, serial, sex) end end end ) end end ) end )
-
I'm not sure I could explain this in English, because It was not just in my native Russian. But im try and hope someone understand and help me with this bug. Problem with the auth/reg resource (only when it is started) which I can not understand and solve. When it resource is started, it and other resources started in multiple copies, as a result of which all actions are performed many times (creating GUI, output text in chat, etc. deleting elements works with only one instance). resource has nothing to do with the others. Has no functions to start / restart resources, only uses the exported function connection to mysql database and dgs (The problem was before using dgs). I absolutely can not understand why this is happening. The same happens when other resources are started, if the authorization resource is started. Those. If I start or restart the resource using the console, new copies of other resources are started. if for example I restart another resource three times then three new copies of other resources will be launched and three authorization windows will be created. But if I restart the authorization resource, then after creating only one window rather than a 5, as in the first run, but when I authorize, many messages output in chat, and not one. In the debug, there are no errors related to this.
-
[Scripting] Changing the programming language.
GodOfPenguins replied to Marcosha_'s topic in Suggestions
Lua - very simple language. That information on russian language, which available, is enough. And even better to just learn English. -
Имеется проблема с ресурсом авторизации/регистрации (проблема возникает только, когда он запущен), которую я не могу понять и решить. При запуске этого ресурса он и другие ресурсы запускаются в нескольких копиях, в результате чего все действия выполняются множество раз (создание GUI, вывод текста в чат и т.п, хотя удаление элементов работает только с одним экземпляром). Ресурс никак не связан с другими. Не имеет функций для запуска/перезапуска ресурсов, использует только экспортированную функцию подключения к mysql базе и dgs (проблема была и до использования dgs, он к этому не относится). Из-за этого совершенно не могу понять, почему так получается, может тут кто-нибудь сможет помочь? Тоже самое происходит при запуске других ресурсов, если ресурс авторизации запущен. Т.е. если я запущу или перезапущу через консоль ресурс, то запускаются новые копии других ресурсов. Т.е. он опять ещё и запускает новые копии других ресурсов. При этом если я например три раза перезапущу другой ресурс, то соответственно запуститься три новых копии других ресурсов и создаться три окна авторизации, но если я перезапущу ресурс авторизации, то после создаться только одно окно, а не десяток, как при первом запуске. Но когда авторизовываюсь, то в чат выводится много одинаковых сообщений об этом, а не одно. В дебаге никаких ошибок, связанных с этим нет.
-
Подскажите по поводу loadstring. В функцию передаётся переменная, в которой записан код как строка. Как выполнить этот код? loadstring(action1) не работает и ошибок в дебаг не выводит. В переменной всё на месте, остальные действия выполняются, поэтому проблема именно в loadstring.
-
При запуске редактора на выделенном сервере, он загружает мир обратно.
-
1. Возможно ли использование MAP Editor для создания карты с нуля? Т.е. 1) Как удалить всю карту? Есть только скрипт, который удаляет её на сервере, но как удалить её в редакторе? 2) Возможна ли замена моделей и текстур, для использования в MAP Editor? 2. Какие требования нужно соблюдать, чтобы модель, созданная в 3DS Max, корректно работала в MTA и есть ли какие-либо нюансы в этом плане?
-
Выдаёт ошибку, что второй аргумент (кнопки) "got nil". Кнопка естественно не работает. Работающие решение проблемы так и не нашёл. addEventHandler("onClientGUIClick", button[1], function() local log, pass = guiGetText(edit[1]), guiGetText(edit[2]) if(log == "") or (pass == "") then outputChatBox("Не заполнено одно из полей!") else triggerServerEvent("ClientLogin", getLocalPlayer(), log, pass) end end, false) Сам GUI: local window = {} local tabpanel = {} local tab = {} local edit = {} local label = {} local button = {} addEventHandler("onClientResourceStart", getResourceRootElement(), function() window[1] = guiCreateWindow(0.27, 0.29, 0.45, 0.41, "Авторизация", true) guiWindowSetSizable(window[1], false) tabpanel[1] = guiCreateTabPanel(0.02, 0.04, 0.97, 0.93, true, window[1]) tab[1] = guiCreateTab("Авторизация", tabpanel[1]) edit[1] = guiCreateEdit(173, 92, 209, 20, "", false, tab[1]) edit[2] = guiCreateEdit(174, 138, 208, 20, "", false, tab[1]) label[1] = guiCreateLabel(183, 11, 189, 32, "Введите данные своего аккаунта", false, tab[1]) label[2] = guiCreateLabel(79, 96, 84, 16, "Имя_Фамилия:", false, tab[1]) label[3] = guiCreateLabel(79, 140, 84, 18, "Пароль:", false, tab[1]) button[1] = guiCreateButton(205, 197, 152, 42, "Войти!", false, tab[1]) tab[2] = guiCreateTab("Регистрация", tabpanel[1]) end )
-
Как сделать проверку на ID транспорта при въезде на маркер? Т.е. например, чтобы второй маркер создавался только, если въехать на первый маркер на транспорте с определённым ID (В моём случае 577).
-
Нужен маппер(ы) для создания военного маппинга по всей карте. *Цена: договорная. *Опыт и возраст не важен. Главное - умение. Связь: https://vk.com/id251333498