Sergioks Posted February 5, 2016 Posted February 5, 2016 Buenas, tengo una duda que siempre la he tenido. Siempre que trato de hacer un script como este caigo y no se porque Bueno, me problema es el siguiente: Estoy haciendo un sistema de reportes para mi servidor, el cual consiste en escribir el comando /report y toma la fotografia con takePlayerScreenShot y que lo guarde en los archivos del script. (client/files/reportes/cuenta/dia-mes-año/mensaje.jpg). Y que luego, se la muestre al usuario en una GUI para que decida si enviar el reporte o no, y colocar un mensaje para el staff. Sin embargo, el programa no muestra la imagen del reporte.. Server-Side: function onScreenShotTaked(theResource, status, pixels, timestamp, tag) if ( theResource == getThisResource() ) then ---- local time = getRealTime(timeStamp) local year = time.year + 1900 local month = time.month + 1 local day = time.monthday local hour = time.hour local minute = time.minute -- local id = dbPoll(dbQuery(db, "SELECT * FROM reports"), -1) local filepath = ("client/files/reportes/%s/[%s][%s][%s]/[%s][%s][%s](%d).jpg"):format(getAccountName(getPlayerAccount(source)), day, month, year, hour, minute, tag, #id + 1) local file = fileCreate(filepath) or fileOpen(filepath) fileWrite(file, pixels) fileClose(file) -- local reportPath = ("client/files/reportes/%s/[%s][%s][%s]/[%s][%s][%s](%d)"):format(getAccountName(getPlayerAccount(source)), day, month, year, hour, minute, tag, #id + 1) if ( not reportPath ) then outputChatBox("* El reporte no pudo tomarse!! Reporta esto a un staff!", source, 255, 0, 0, true) return end -- ---- triggerClientEvent(source, "acp.verifyReport", source, reportPath ) end end addEventHandler("onPlayerScreenShot", root, onScreenShotTaked) Client-side: addEvent("acp.verifyReport",true) addEventHandler( "acp.verifyReport", root, function( img ) reports_open_close() -- filepath = img..".jpg" guiStaticImageLoadImage(zRACP.staticimage[3], filepath) end ) Debugscript: WARNING: acp/report_c.lua:415: Error loading image @'guiStaticImageLoadImage' [E:\MTA San Andreas 1.5\mods\deathmatch\resources\acp\client\files\reportes\Sergioks\05-02-2016\Reporte de Sergioks.jpg] ¿como puedo hacer en este caso? alguien me ayuda? Espero sus respuestas y gracias por leer Instagram | ¡Sígueme en YouTube! | Facebook Todo se puede con algo de esfuerzo
Sasu Posted February 7, 2016 Posted February 7, 2016 Estas guardando los archivos en el servidor, no en el cliente. State: Inactive
Tomas Posted February 7, 2016 Posted February 7, 2016 Puedes pasar los píxeles a través del trigger y luego dibujar la imágen con dxDrawImage y dxCreateTexture Currently developing for International Gaming Community - Join us!
Recommended Posts