i was trying to accomplish a flexible list system, using a .txt, and my average scripting skills.
it worked on a non-dedicated server, but it completly ruined the dedicated server. (crashed it, not corrupted it.)
here was the code for that, it was made along with a gui, so ignore any: (its not going to be released, and its broken. dont copy it.)
function servercmdreserve(%client, %id, %type, %g)
{
if(!%client.isAdmin)
return;
if(%id $= "")
return;
for(%c=0;%c<strLen(%id);%c++)
{
%char[%c]=sn(getSubStr(%id,%c,1));
if(%char[%c] !$= "NONE")
{
%char[%c] = %char[%c];
%id[%a++] = %char[%c];
}
}
%id = %id[%a - %a + 1] @ %id[%a - %a + 2] @ %id[%a - %a + 3] @ %id[%a - %a + 4] @ %id[%a - %a + 5];
if(%type $= "")
{
%type = 1;
}
%val = %id TAB %type;
%line = ln(%id, %type);
if(%type == 2 && ln(%id) == 0)
{
return;
}
if(%type == 2 && ln(%id) >= 1)
{
$Res::ResC--;
ReservedIDs.setSelectedRow(1);
}
if(%type == 1 && ln(%id) == 0)
{
$Res::ResC++;
}
if(%type == 1 && ln(%id) >= 1)
{
if(ln2(%id) == 1)
{
return;
}
}
if(%line == 0)
$Res::Line[$Res::LineCount++] = %val;
else
$Res::Line[%line] = %val;
%file = new FileObject();
%file.openForWrite("config/server/res/res.txt");
%file.writeline("--RESERVATION LIST--");
for(%i=1;%i<=$Res::LineCount;%i++)
{
if(getField($Res::Line[%i], 1) $= 1)
{
%file.writeLine($Res::Line[%i]);
}
}
%file.close();
%file.delete();
if(%g $= "")
{
%g = 2;
}
if(%g == 1)
{
canvas.popdialog(ReserveGUI);
canvas.pushdialog(ReserveGUI);
}
}