Jump to content

I need a help from someone! Please...


Focker

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...