addEvent("crear:Report",true)
addEventHandler("crear:Report",root,function( motivo, descripcion, yo)
local reporteXML = xmlCreateFile( ":reportGUI/reportes/"..motivo..".xml", "reporte" )
local contenido = xmlCreateChild( reporteXML, "reporte" )
local motivoXML = xmlNodeSetAttribute( contenido, "motivoR", motivo )
local descripcionXML = xmlNodeSetAttribute( contenido, "descripcionR", descripcion )
local creadorXML = xmlNodeSetAttribute( contenido, "creadorR", getPlayerName( yo ) )
local estadoXML = xmlNodeSetAttribute( contenido, "estadoR", 'no leido' )
xmlSaveFile(reporteXML)
if ( reporteXML ) then
outputChatBox("Reporte Creado Exitosamente, poniendolo en la lista de reportes...",source)
addEventHandler("crearRow", root, crearRowF)
end
end
)
addEvent("crearRow",true)
function crearRowF(motivo)
local reporte = xmlLoadFile( ":reportGUI/reportes/"..motivo..".xml")
if ( reporte ) then
local contenido = xmlFindChild( reporte, "reporte" )
local motivoXML = xmlNodeGetAttribute( contenido, "motivoR" )
local descripcionXML = xmlNodeGetAttribute( contenido, "descripcionR" )
local creadorXML = xmlNodeGetAttribute( contenido, "creadorR" )
local estadoXML = xmlNodeGetAttribute( contenido, "estadoR" )
end
end