PHP Code:
function onActionServerSide( afi, svar1, svar2 ) {
switch( afi ) {
case "callTextTypeFile": {
temp.text_type_file.loadLines( svar1 );
triggerClient( "gui", name, "displayTextTypeFile", temp.text_type_file );
break;
}
case "editTextTypeFile": {
temp.text_type_file = { svar1 };
temp.text_type_file.saveLines( svar2, 0 );
break;
}
}
}
//#CLIENTSIDE
function onActionClientSide( afi, file ) {
switch( afi ) {
case "displayTextTypeFile": {
for ( temp.i : file ) {
temp.ne @= temp.i @ "\n"; <-- This is the problem
}
onEditTextTypeFile( temp.ne );
break;
}
}
}
function onPlayerChats() {
temp.tokens = player.chat.tokenize();
if ( player.chat.starts( "/lf " ) ) {
this.file_selected = temp.tokens[ 1 ];
triggerServer( "gui", name, "callTextTypeFile", temp.tokens[ 1 ] );
}
}
function onEditTextTypeFile( svar ) {
Gui stuff here, removed for space reasons
}
The problem is not in the GUI or loading the text file, it's the text file itself. \n obviously won't make a new line in the text file, but it will the GUI. How would I go about making a new line, in both, the text file and the GUI?