Jump to content

FlorinSzasz

Members
  • Posts

    136
  • Joined

  • Last visited

  • Days Won

    5

FlorinSzasz last won the day on August 29 2023

FlorinSzasz had the most liked content!

1 Follower

About FlorinSzasz

  • Birthday 01/04/2001

Details

  • Gang
    Scripters
  • Location
    Romania
  • Occupation
    College Student, Accountant
  • Interests
    To get better at scripting

Recent Profile Visitors

1,086 profile views

FlorinSzasz's Achievements

Busta

Busta (15/54)

42

Reputation

  1. You could use this resource is old but good and it works i used it when i was a beginner in scripting. https://www.youtube.com/watch?v=kazisZj-E98 https://forum.multitheftauto.com/topic/23029-rel-house-system-sql/ https://community.multitheftauto.com/index.php?p=resources&s=details&id=727
  2. Niște afiramții/formulări ce pot fi utile când dorim să aflăm informații legate de un anumit tabel sau coloane ce corespund unui tabel dintr-o bază de date. --- varianta MySQL local rez = dbPoll(dbQuery(connection,"SELECT table_name FROM information_schema.tables WHERE table_schema = '"..name.."';"),-1) -- inlocuiți name cu numele bazei de date de la care doriți să aflați informații legate de tabele -- rez o sa returneze un tabel cu denumirile tabelelor din baza de date pe care ați asociat-o cu variabila name for k,v in pairs(rez) do outputDebugString(v.table_name) end local rez = dbPoll(dbQuery(connection,"SELECT COLUMN_NAME,DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '"..table.."' ORDER BY ORDINAL_POSITION"),-1) -- selectam denumirea coloanelor si tipul datelor pentru tabela aflata sub variabila table for k,v in pairs(rez) do outputDebugString(v.COLUMN_NAME) outputDebugString(v.DATA_TYPE) end ---------------------- -- Pentru SQLite local rez = dbPoll(dbQuery(connection,"SELECT name FROM sqlite_master WHERE type='table';"),-1) -- aici nu mai aveti nevoie de denumirea bazei de date deoarece se returneaza tabelele din baza de date la care sunteti conectat. for k,v in pairs(rez) do if v.name ~= "sqlite_sequence" then outputDebugString(v.name) end end local rez = dbPoll(dbQuery(connection,"PRAGMA table_info("..tostring(table)..")"),-1) -- selectam date legate de coloane -- table este denumirea tabelului de la care dorim sa aflam date legate de coloane. for k,v in pairs(rez) do outputDebugString(v.name) outputDebugString(v.type) end
  3. Update 1.2 și 1.2.1 Update-ul 1.2 este dbFrame varianta pentru MySQL iar 1.2.1 este noul update pentru dbFrame pe SQLite. Ambele cuprind funcția nouă pentru drop table, optimizări au fost aduse codului. Din acest update nu mai este nevoie de restart dupa crearea unei baze de date mai mult decat atât totul se va face acum din panel, fără a mai fi nevoie de comenziile /GUIcreatetable /GUIinsert etc.
  4. This can be an option but it may look ugly even with the right color. https://wiki.multitheftauto.com/wiki/DxDrawLine3D
  5. This should help you https://wiki.multitheftauto.com/wiki/SetColShapeSize
  6. local result = dbPoll(dq,250) -- this should --be like this local result = dbPoll(dq,-1) --Also is result[1]["password"] encrypted? when you insert it into the database? passwordVerify(pass,result[1]["password"]) --------------------------------------------------- addEvent("login", true) addEventHandler("login", root, function (user, pass) local serial = getPlayerSerial(client) local dq = dbQuery(db, "SELECT * FROM accounts WHERE serial=?", serial) local result = dbPoll(dq,-1) if (#result > 0) then if user == result[1]["username"] then if (passwordVerify(pass,result[1]["password"])) then print("Sikeres bejelentkezés!") else print("Hibás jelszó!") end else print("Felhasználónév nem található!") end else print("Sikertelen bejelentkezés!") end end)
  7. i think there is full gamemode to look at which might make the things more complicated :)) thats why we dont get any lines of code.
  8. Update 1.1 Update de securitate orice panel poate fi accesat doar de un admin în cazul în care nu folosiți un acl.xml custom altfel intervine nevoia unor modificări suplimentare.
  9. he means the interiors table structure like what columns and data type do you have and so on.
  10. Update 1.02 niște buguri legate de funcțiile updateTable/InsertIntoTable au fost fixate și niște erori client side!
  11. UPDATE 1.01 au fost rezolvate niște buguri legate de funcția SelectFromTable() https://community.multitheftauto.com/index.php?p=resources&s=details&id=18897 Mai jos este prezentat un exemplu practic de utilizare a celor 3 funcții exportate! --Example -- create the first db or second or third ... you know -- restart the resource -- create a table for one of your databases ---my id of db is 1 (your id can be 2 or 3 it depends on how many dbs you have created and which one you want to use) ---my table name is tutorial -- username is column of reference when i select and update data! addEventHandler ('onPlayerLogin',getRootElement(),function (_,theCurrentAccount) local acc_name = getAccountName(getPlayerAccount(source)) if acc_name then -- db id 1 / table tutorial / column username / and we look for username account name! rezult = exports["dbFrame"]:SelectFromTable(1,"tutorial","username",acc_name) if rezult then for k,v in ipairs(rezult) do setPedArmor(source,v.armour) setPlayerMoney(source,v.money) setElementModel(source,v.model) end else exports["dbFrame"]:InsertIntoTable(1,"tutorial",acc_name,"username",acc_name) end end end) addEventHandler("onPlayerQuit",getRootElement(),function() local acc_name = getAccountName(getPlayerAccount(source)) if acc_name then exports["dbFrame"]:updateTable(1,"tutorial","username",acc_name,"armour,money,model",getPedArmor(source),getPlayerMoney(source),getElementModel(source)) end end)
  12. DBFrame este o resursă dedicată celor care nu au experiență în utilizarea bazelor de date sau celor care doresc o abordare diferită în utilizarea acestora. Resursa oferă un panel pentru: - inserare in tabel - update de tabel - creare de tabel - ștergerea unui rând din tabel - crearea de baze de date - pentru a vizualiza bazele de date existente - pentru a vedea denumirea coloanelor dintr-un tabel și tipul de date pe care îl reprezintă Bonus funcții exportate: updateTable() InsertIntoTable() SelectFromTable() // Funcțiie sunt explicate mai detaliat in documentul info.txt din arhiva unde sunt regăsite resursele. Link -> https://community.multitheftauto.com/index.php?p=resources&s=details&id=18897
  13. Interesting, i never had this problem. You need to add this in registerWindow function toggleControl("chatbox",false) And also add this into your dgs mouse click EventHandler function. if source == buttonExecute then -- after this line of code add the line of code i wrote below toggleControl("chatbox",true) I also want to say there is no stupidity you just want to do to much to fast, take your time and read the wiki and topics on forum. With the time you will learn faster or slower it doesnt matter, if you put a little bit of work you will learn something today, something tomorrow and so on. https://forum.multitheftauto.com/forum/123-tutorials/ https://www.youtube.com/@ngear2872/videos
  14. Client Side we have to do this Also you dont need openPanel or closePanel functions you can delete this functions and in first part of the script put all things in a function like i did. local playerPassportEdit = createMarker(-712.9, 962.5, 12.3-1.7,"cylinder",2.0,255,0,0,104) local on = 0 function registerWindow() if on == 1 then return end on = 1 window = dgs:dgsCreateWindow(((sw-800)/2)*px,((sh-600)/2)*py,800*px,600*py,"Паспорт",false) buttonExecute = dgs:dgsCreateButton(325*px,530*py,150*px,40*py,"Подтвердить",false,window,nil,nil,nil,nil,nil,nil,tocolor(255,0,0),tocolor(100,0,0),tocolor(255,0,0)) labelFirstName = dgs:dgsCreateLabel(200*px,200*py,400*px,30*py," Имя: ",false,window) editFirstName = dgs:dgsCreateEdit(200*px,220*py,400*px,30*py,"",false,window,tocolor(255,255,255),nil,nil,nil) dgs:dgsSetProperty(labelFirstName,"alignment",{"center"}, {"center"}) dgs:dgsSetProperty(editFirstName,"alignment",{"center"}, {"center"}) labelLastName = dgs:dgsCreateLabel(200*px,270*py,400*px,30*py," Фамилия: ",false,window) editLastName = dgs:dgsCreateEdit(200*px,290*py,400*px,30*py,"",false,window,tocolor(255,255,255),nil,nil,nil) dgs:dgsSetProperty(labelLastName,"alignment",{"center"}, {"center"}) dgs:dgsSetProperty(editLastName,"alignment",{"center"}, {"center"}) labelAge = dgs:dgsCreateLabel(200*px,340*py,400*px,30*py," Возраст: ",false,window,tocolor(255,255,255),nil,nil,nil) editAge = dgs:dgsCreateEdit(200*px,360*py,400*px,30*py,"",false,window) dgs:dgsSetProperty(labelAge,"alignment",{"center"}, {"center"}) dgs:dgsSetProperty(editAge,"alignment",{"center"}, {"center"}) labelCountry = dgs:dgsCreateLabel(200*px,410*py,400*px,30*py," Страна: ",false,window,tocolor(255,255,255),nil,nil,nil,tocolor(100,100,100,100)) editCountry = dgs:dgsCreateEdit(200*px,430*py,400*px,30*py,"",false,window) dgs:dgsSetProperty(labelCountry,"alignment",{"center"}, {"center"}) dgs:dgsSetProperty(editCountry,"alignment",{"center"}, {"center"}) dgs:dgsWindowSetMovable(window,false) dgs:dgsWindowSetSizable(window,false) dgs:dgsWindowSetCloseButtonEnabled(window,false) showCursor(true) end function passportRegister ( hitPlayer, matchingDimension ) if hitPlayer == localPlayer and source == playerPassportEdit then registerWindow() end end addEventHandler ( "onClientMarkerHit", getResourceRootElement(), passportRegister ) --------- here we need to add somehting --- addEventHandler("onDgsMouseClick",root,function(btn,state) if btn == "left" and state == "down" then if source == buttonExecute then local firstName = dgs:dgsGetText(editFirstName) local lastName = dgs:dgsGetText(editLastName) local age = dgs:dgsGetText(editAge) local country = dgs:dgsGetText(editCountry) if not string.find(firstName,"%S") then outputChatBox("Name") return end if not string.find(lastName,"%S") then outputChatBox("LastName") return end if not string.find(age,"%d") then outputChatBox("Age") return end if not string.find(country,"%S") then outputChatBox("Country") return end triggerServerEvent("playerPassportEnter",localPlayer,firstName,lastName,age,country) -- also here we need this dgs:dgsSetVisible(window,false) showCursor(false) on = 0 end end end)
  15. Data from db is static it wont change unless you want to update it. It will be always the same because players cant make any changes. If you mean you can edit the client side memo you can do this to disable that. https://wiki.multitheftauto.com/wiki/DgsMemoSetReadOnly -- client side -- you look after this line of code local CountryInfo = dgs:dgsCreateMemo(10,100,150,25,"Страна: "..rezult[1]['Country'].."",false,passport_info) --after this line you add this lines of code dgsMemoSetReadOnly(firstNameInfo,true) dgsMemoSetReadOnly(lirstNameInfo,true) dgsMemoSetReadOnly(ageInfo,true) dgsMemoSetReadOnly(CountryInfo,true)
×
×
  • Create New...