-
Posts
7,337 -
Joined
-
Days Won
11
Everything posted by TAPL
-
2500+ lines? no thanks.
-
https://wiki.multitheftauto.com/wiki/Scripting_Introduction https://wiki.multitheftauto.com/wiki/Introduction_to_Scripting_the_GUI https://wiki.multitheftauto.com/wiki/Debugging
-
The problem from your ACL, even your code will work, i just optimize the code.
-
ناسخ امثلة الويكي و جاي لنا تقول عملت لوحة تسجيل و ما تشتغل؟
-
onPlayerLogin is event not function. Maybe you should spend more time reading the wiki? https://wiki.multitheftauto.com/wiki/Scripting_Introduction
-
If you used client side xml then yes they can edit it as client side xml will be stored on players hard disk.
-
getVehicleNameFromModel_ = getVehicleNameFromModel function getVehicleNameFromModel(vehID) local vehiclen = getVehicleNameFromModel_(vehID) if vehiclen then return vehiclen:lower() end return false end OR try to explain better.
-
Most likely there's another resource shows the hud again. Also avoid fileDelete it's better to use cache in meta: <script src="filename.lua" type="client" cache="false"/>
-
addCommandHandler("gh", function(player) for _,v in ipairs (getElementsByType("player")) do setElementHealth(v, 100) end exports["guimessages"]:outputServer(root, "#ff0000*#ffff00[Admin]#00ff00 "..getPlayerName(player).." #33CCCC Has Give All Players #ffff00Health", 255,105,180) end) + الكود سيرفر مو كلينت
-
'onClientGUIClick' guiGetText triggerServerEvent aclGetGroup isObjectInACLGroup triggerClientEvent or setElementData/getElementData + 'onClientElementDataChange' guiSetText
-
It's already been checked with SELECT, as you can see here it only select rows that have 'account' column equal to the account name and it limited to only one row as we already know there won't be more than one row for each account name. It return nil because i didn't select the account name as it not needed, you already know it as you have pass it to the SQL query.
-
Why you need to do that? It already done with the SQL SELECT.
-
احذف السطر ذا من الكلينت setElementDimension (localPlayer,0) و حطه بالسيرفر function destroyvehh() destroyElement (veh) setElementDimension (client,0) setElementPosition (client,1099.63660 ,1607.46045 ,12.54688) end addEvent ("destroyVeh",true) addEventHandler ("destroyVeh",root,destroyvehh) و انتبه تغير العالم من الكلينت لان رح يسبب مشاكل بالمزامنة دائماً غير العالم من جانب السيرفر
-
https://wiki.multitheftauto.com/wiki/Scripting_Introduction
-
Try delete the table and start the resource again.
-
Try: local connection = exports.sql:getSQLConnection() addEventHandler("onResourceStart", resourceRoot, function() dbExec(connection, "CREATE TABLE IF NOT EXISTS accountdata (account TEXT, x TEXT, y TEXT, z TEXT, money INTEGER)") end) function saveDataBase(account) local account = eventName == "onPlayerLogout" and account or getPlayerAccount(source) if account and not isGuestAccount(account) then local money = getPlayerMoney(source) local x, y, z = getElementPosition(source) local accountName = getAccountName(account) if AccountExist(accountName) then dbExec(connection, "UPDATE accountdata SET x = ?, y = ?, z = ?, money = ? WHERE account = ?", x, y, z, money, accountName) else dbExec(connection, "INSERT INTO accountdata VALUES (?, ?, ?, ?, ?)", accountName, x, y, z, money) end end end function AccountExist(accountName) local result = dbPoll(dbQuery(connection, "SELECT x, y, z, money FROM accountdata WHERE account = ? LIMIT 1", accountName),-1) if type(result) == "table" and #result > 0 then return result[1] end return false end function loadDataBase(_, account) local data = AccountExist(getAccountName(account)) if data then setPlayerMoney(source, data["money"]) spawnPlayer(source, data["x"], data["y"], data["z"]) fadeCamera(source, true) setCameraTarget(source) end end addEventHandler("onPlayerLogin", root, loadDataBase) addEventHandler("onPlayerQuit", root, saveDataBase) addEventHandler("onPlayerLogout", root, saveDataBase)
-
Try this (Not tested). GUI = guiCreateWindow(436, 271, 253, 246, "SAEG - Password Changer", false) guiWindowSetSizable(GUI, false) guiSetVisible(GUI, false) showCursor(false) Label_Account = guiCreateLabel(10, 31, 52, 15, "Account:", false, GUI) Cuenta = guiCreateLabel(72, 31, 171, 15, "none", false, GUI) guiLabelSetColor(Cuenta, 255, 0, 0) Label_Newpass1 = guiCreateLabel(10, 56, 233, 19, "New Password:", false, GUI) guiLabelSetHorizontalAlign(Label_Newpass1, "center", false) Edit_pass1 = guiCreateEdit(10, 81, 233, 24, "Password", false, GUI) Label_Newpass2 = guiCreateLabel(10, 115, 233, 19, "Repeat New Password:", false, GUI) guiLabelSetHorizontalAlign(Label_Newpass2, "center", false) Edit_pass2 = guiCreateEdit(10, 144, 233, 24, "Password", false, GUI) Boton_change = guiCreateButton(45, 178, 81, 26, "Change", false, GUI) guiSetProperty(Boton_change, "NormalTextColour", "FFAAAAAA") Boton_cancel = guiCreateButton(126, 178, 81, 26, "Cancel", false, GUI) guiSetProperty(Boton_cancel, "NormalTextColour", "FFAAAAAA") Boton_help = guiCreateButton(86, 204, 81, 26, "Help", false, GUI) guiSetProperty(Boton_help, "NormalTextColour", "FFAAAAAA") GUI2 = guiCreateWindow(690, 271, 256, 315, "Help", false) guiWindowSetSizable(GUI2, false) guiSetVisible(GUI2, false) scrollpanel = guiCreateScrollPane(10, 27, 236, 241, false, GUI2) text_help = guiCreateLabel(0, 0, 243, 245, "/changepass = open panel\n\n*remember to log in.\n*CHANGE = change the password.\n*CANCEL = close panel.\n*HELP = open help panel.\n*CLOSE = close help panel\n\n", false, scrollpanel) Boton_close = guiCreateButton(86, 278, 85, 25, "CLOSE", false, GUI2) guiSetProperty(Boton_close, "NormalTextColour", "FFAAAAAA") addEvent("OnDatas",true) addEventHandler("OnDatas", root, function(PCuenta) guiSetText(Cuenta, PCuenta) guiSetVisible(GUI, true) showCursor(true) end) addEventHandler("onClientGUIClick", guiRoot, function() if (source == Edit_pass1) then guiSetText(Edit_pass1, "") guiEditSetMasked(Edit_pass1, true) elseif source == Edit_pass2 then guiSetText(Edit_pass2, "") guiEditSetMasked(Edit_pass2, true) elseif source == Boton_change then local newpass1 = guiGetText(Edit_pass1) local newpass2 = guiGetText(Edit_pass2) if (newpass1 == newpass2) then triggerServerEvent("Cambiar", localPlayer, newpass1) else triggerServerEvent("ErrorPass", localPlayer) end elseif source == Boton_close then guiSetVisible(GUI2, false) elseif source == Boton_cancel then guiSetVisible(GUI, false) guiSetVisible(GUI2, false) showCursor(false) elseif source == Boton_help then guiSetVisible(GUI2, not guiGetVisible(GUI2)) end end) addCommandHandler("changepass", function(player) local account = getPlayerAccount(player) if account and not isGuestAccount(account) then triggerClientEvent(player, "OnDatas", player, getAccountName(account)) else exports.SAEGMessages:sendClientMessage("[sERVER] Please log in to use this feature.", player, 255, 255, 255, true) end end) addEvent("ErrorPass", true) addEventHandler("ErrorPass", root, function() exports.SAEGMessages:sendClientMessage("[sERVER] Passwords do not match.", client, 255, 255, 255, true) end) addEvent("Cambiar", true) addEventHandler("Cambiar", root, function(newpass1) local account = getPlayerAccount(client) if account and not isGuestAccount(account) then setAccountPassword(account, newpass1) exports.SAEGMessages:sendClientMessage("[sERVER] The account password has been changed.", client, 255, 255, 255, true) exports.SAEGMessages:sendClientMessage("[ACCOUNT][uSER: "..getAccountName(account).." ] - [NEW PASSWORD: "..newpass1.." ].", client, 255, 255, 255, true) else exports.SAEGMessages:sendClientMessage("[sERVER]Please log in to change the password.", client, 255, 255, 255, true) end end)
-
تحتاج تستخدم الفنكشن ذا get و بما ان الفنكشن ذا جانب سيرفر فقط و كود الي يسوي الكلام موجود بالكلينت راح تحتاج تريقر او المنت داتا
