Hey leute ich habe mal nen kleines Support-System gemacht was ja eigentlich einfach ist aber dieses script erstellt einfach nicht die .txt -.-'
Lua
function Support_Panel()
if open == false then
open = true
showCursor( true )
ReportWindow = guiCreateWindow(501, 208, 412, 448, "Support-System", false)
guiWindowSetSizable(ReportWindow, false)
guiWindowSetMovable(ReportWindow, false)
ReportMemo = guiCreateMemo(23, 90, 369, 228, "Schreibe hier deinen text rein den du senden willst.\nt", false, ReportWindow)
guiSetAlpha(ReportMemo, 0.72)
PrioComobox = guiCreateComboBox(130, 339, 152, 100, "", false, ReportWindow)
guiComboBoxAddItem(PrioComobox, "Leicht")
guiComboBoxAddItem(PrioComobox, "Normal")
guiComboBoxAddItem(PrioComobox, "Sehr Wichtig!")
BetreffMemo = guiCreateMemo(22, 41, 122, 31, "", false, ReportWindow)
guiSetAlpha(BetreffMemo, 0.73)
BetreffLabel = guiCreateLabel(24, 24, 65, 15, "Betreff", false, ReportWindow)
guiSetFont(BetreffLabel, "default-bold-small")
ReportSendButton = guiCreateButton(26, 377, 101, 34, "Report Send!", false, ReportWindow)
guiSetFont(ReportSendButton, "default-bold-small")
guiSetProperty(ReportSendButton, "NormalTextColour", "FFAAAAAA")
CloseReportButton = guiCreateButton(286, 375, 101, 34, "Close", false, ReportWindow)
guiSetFont(CloseReportButton, "default-bold-small")
guiSetProperty(CloseReportButton, "NormalTextColour", "FFAAAAAA")
ReportLabel = guiCreateLabel(24, 76, 85, 15, "Report Tex t", false, ReportWindow)
guiSetFont(ReportLabel, "default-bold-small")
PrioLabel = guiCreateLabel(175, 320, 59, 17, "Prioität", false, ReportWindow)
guiSetFont(PrioLabel, "default-bold-small")
addEventHandler('onClientGUIClick', ReportSendButton, sendingReport, false )
addEventHandler('onClientGUIClick', CloseReportButton, CloseSupportWindow_function, false )
else
guiSetVisible( ReportWindow, false )
showCursor( false )
open = false
end
end
bindKey('o','down',Support_Panel)
function CloseSupportWindow_function()
showCursor( false )
destroyElement( ReportWindow )
end
function sendingReport()
local send = tostring ( guiGetText ( BetreffMemo ) )
local text = tostring ( guiGetText ( ReportMemo ) )
local name = getPlayerName(localPlayer)
local file = fileOpen("reports/"..name..".txt", false)
local fileSize = fileGetSize(file)
if #text > 3 and #send > 3 and send ~= "" and text ~= "" then
if (file) then
outputChatBox("Report Send!", 0, 155, 0)
fileSetPos(file,fileSize)
fileWrite(file,"[Betreff]:"..send.."\n") -- write a text line
fileWrite(file,"[Report]:"..text.."\n")
fileClose(file)
CloseSupportWindow_function()
else
local file = fileCreate("reports/"..name..".txt")
local fileSize = fileGetSize(file)
fileSetPos(file,fileSize)
fileWrite(file,"[Betreff]:"..send.."\n") -- write a text line
fileWrite(file,"[Report]:"..text.."\n")
fileClose(file)
end
else
outputChatBox('Pleas write a text in that memo!', 255, 0, 0)
end
end
Alles anzeigen
ERRORS KEINE!!
SCRIPT WILL NUR DIE DATEI NICHT ERSTELLEN DER REST GEHT IST ABER WAHRSCHEINLICH VON MTA EIN FEHLER!.