function servercmdreport(%client, %c1, %c2, %c3, %c4, %c5, %c6, %c7, %c8, %c9, %c10, %c11, %c12, %c13, %c14, %c15, %c16, %c17, %c18, %c19, %c20)
{
%text="";
for(%j=1;%j<=20;%j++)
{
%text = %text SPC %c[%j];
}
messageclient(%client,'',"\c5You reported\c4:"@%text);
for(%i=0;%i<clientGroup.getcount();%i++)
{
%b=clientgroup.getobject(%i);
if(%b.isAdmin)
{
messageclient(%b,'',"\c5"@%client.name@" reports\c4:"@%text);
}
}
}
https://www.dropbox.com/s/k1rbnotec6a2fki/Server_Report.zip[/quote]
Add a write to file function so that reports can be logged. In case the only admin online is the badmin.
function writeToFile(%name, %content)
{
if(%name $= "")
{
messageClient(%client,'',"\c6[\c3WtF\c6]: Useage /writeToFile filename.cs 'content' ");
}
else
{
%outFileHandle = new FileObject() ;
%outFileHandle.openForAppend(%name) ;
%outFileHandle.writeLine(%content) ;
%outFileHandle.close() ;
}}
function readFromFile(%filename)
{
if(%filename $= "")
{messageClient(%client,'',"No filename defined");}
%inFileHandle = new FileObject() ;
%inFileHandle.openForRead(%filename) ;
while(!%inFileHandle.IsEOF())
{
%inLine = %inFileHandle.readLine() ;
// output read text to console.
echo(%inLine) ;
}
%inFileHandle.close() ;
}