Focker Posted July 12, 2015 Share Posted July 12, 2015 Hello I need your help on this script that I'm doing well I want to be deleted from the list marrow to select the log from the list and can delete a button, the problem in the script is that I deleted everything and I just want to delete the selected down here I can see the script Client function veryaellogad(tab) guiGridListClear(logadmin) for i, gs in pairs(tab) do local row = guiGridListAddRow(logadmin) guiGridListSetItemText(logadmin, row,logadm1, gs.Fecha, false, true) guiGridListSetItemText(logadmin, row,logadm2, gs.Admin, false, true) guiGridListSetItemText(logadmin, row,logadm3, gs.Premio, false, true) guiGridListSetItemText(logadmin, row,logadm4, gs.Cantidad, false, true) guiGridListSetItemText(logadmin, row,logadm5, gs.SelecTodos, false, true) guiGridListSetItemText(logadmin, row,logadm6, gs.Jugador, false, true) end end addEvent("veryaellog", true) addEventHandler("veryaellog", root, veryaellogad) function borrarlogadmin() local path = guiGridListGetItemData(logadmin, guiGridListGetSelectedItem(logadmin), 1) local plr = guiGridListGetItemText(logadmin, guiGridListGetSelectedItem(logadmin), 6) if path and plr then triggerServerEvent("borrarlogadmin", localPlayer, path,plr) end end Server function resourceStart () executeSQLCreateTable("LogAdmin", "Fecha TEXT,Admin TEXT,Premio TEXT,Cantidad TEXT,SelecTodos TEXT,Jugador TEXT") end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), resourceStart) function VerLogAdmin() tablodelgadmin = executeSQLQuery("SELECT * FROM LogAdmin") triggerClientEvent (source,"veryaellog",source,tablodelgadmin) end addEvent ("VerLogAdmin", true) addEventHandler ("VerLogAdmin", root, VerLogAdmin) addEvent("borrarlogadmin", true) function borrarlogadmin(path, plr) executeSQLDelete("LogAdmin","Fecha", path) executeSQLDelete("LogAdmin","Admin", path) executeSQLDelete("LogAdmin","Premio", path) executeSQLDelete("LogAdmin","Cantidad", path) executeSQLDelete("LogAdmin","SelecTodos", path) executeSQLDelete("LogAdmin","Jugador", path) VerLogAdmin() end addEventHandler("borrarlogadmin", root, borrarlogadmin) Link to comment
GTX Posted July 12, 2015 Share Posted July 12, 2015 Better use DB functions. dbConnect dbQuery dbExec dbPoll Link to comment
Focker Posted July 12, 2015 Author Share Posted July 12, 2015 Could you be more specific please Link to comment
GTX Posted July 12, 2015 Share Posted July 12, 2015 executeSQL functions are deprecated and might not exist in future versions. Replace them with DB functions. Link to comment
GTX Posted July 12, 2015 Share Posted July 12, 2015 Please, understand that executeSQL functions are deprecated and DO NOT work correctly. Take a look at https://wiki.multitheftauto.com/wiki/Ex ... reateTable. Link to comment
Focker Posted July 12, 2015 Author Share Posted July 12, 2015 GTX Thank you Brother (y) Last visit! now set to DB functions as I can delete? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now