Author Topic: Server Update Log Addon  (Read 799 times)

As the title says, I would like a mod that makes it where when a person joins, it shows a update log for the server(in chat or gui box) and if the player types /updates, if shows all the updates.

I know it would be like:

Function cmdupdates()
{
     code here
}

But not the actual code besides this.

Why not make this add-on yourself? You can get started by going to the coding help section we'll be glad to help.

Because I want it to be professional and I just suck way to bad to attempt it.

here's server_rules' server.cs
Code: [Select]
$Rules_File = "config/server/Rules.txt";

function loadRuleFile()
{
    %file = new fileObject(fileStream);
    %file.openForRead($Rules_File);
    %file.readLine();
    //for some reason, isFile is not working
    if(%file.isEOF())
    {
%from = new fileObject();
%to = new fileObject();
%from.openForRead("Add-ons/Server_Rules/defaultRules.txt");
%to.openForWrite($Rules_File);

while(!%from.isEOF())
    %to.writeLine(%from.readLine());
%to.close();
%from.close();
%to.delete();
%from.delete();
    }
    %file.close();
    %file.delete();
    %file = new FileObject();
    %file.openForRead($Rules_File);
    $Rules_Title = %file.readLine();
    $Rules_Body = %file.readLine();
    while(!%file.isEOF())
$Rules_Body = $Rules_Body NL %file.readLine();
    %file.close();
    %file.delete();
}

package Rules
{
    function GameConnection::OnClientEnterGame(%this)
    {
%this.schedule(2500, sendRules);
Parent::OnClientEnterGame(%this);
    }

    function GameConnection::sendRules(%this)
    {
commandToClient(%this,'MessageBoxOK', $Rules_Title, $Rules_Body);
    }
};
activatePackage(Rules);

function ServerCmdRules(%client)
{
    %client.sendRules();
}

function ServerCmdRulesAll(%client)
{
    if(%client.isSuperAdmin)
for(%c = 0; %c < ClientGroup.getCount(); %c++)
    ClientGroup.getObject(%c).sendRules();
}

function ServerCmdReloadRules(%client)
{
    if(%client.isSuperAdmin)
loadRuleFile();
}
loadRuleFile();
with a defaultrules.txt in the addon
Code: [Select]
RULES
1. Do not spam(chat, trust, bricks ETC)
2. Do not ask for admin
3. Do not abuse trust
4. Do not abuse admin

try modifying this?