Author Topic: Could somebody patch this up?  (Read 879 times)

I'm attempting to remove the "hey don't send trust invites" prompt when you join a server. I removed the line but now the script won't execute.
Code: [Select]
$pref::server::disallowinvites = true;
if (isFile("Add-Ons/System_ReturnToBlockland/server.cs"))
RTB_registerPref("Dissallow Invites", "Trust Invites", "$pref::server::disallowinvites", "bool", "server_antiInvite", true, false, false);


package antiInvite
{
function gameConnection::autoAdminCheck(%a,%b,%c)
{
parent::autoAdminCheck(%a,%b,%c);
if($pref::server::disallowinvites == true)

}

function serverCmdTrust_invite(%a,%b,%c,%d,%e,%f)
{
if($pref::server::disallowinvites == true)
{
messageAll('',"\c3The server \c2kicked \c3"@%a.name@"\c2(ID: "@%a.bl_id@") \c3for sending trust invites.");
%a.delete();
}
else
parent::serverCmdTrust_invite(%a,%b,%c,%d,%e,%f);
}
};
activatePackage(antiInvite);

Delete the line after parent::autoAdminCheck(%a,%b,%c);

Do you still want people to be kicked if they send an invite?
« Last Edit: September 16, 2012, 03:58:12 PM by elm »

Pretty sure you have to return the parent on autoAdminCheck

Get rid of this entire part:
Code: [Select]
function gameConnection::autoAdminCheck(%a,%b,%c)
{
parent::autoAdminCheck(%a,%b,%c);
if($pref::server::disallowinvites == true)

}

Remove the whole autoAdminCheck function.

EDIT: Dammit, Greek

Pretty sure you have to return the parent on autoAdminCheck

Yes.

Why are you stealing my mod!?!?!
No, I'm just editing it so that message doesn't appear when you join.
Get rid of this entire part:
Code: [Select]
function gameConnection::autoAdminCheck(%a,%b,%c)
{
parent::autoAdminCheck(%a,%b,%c);
if($pref::server::disallowinvites == true)

}
I'll try that out, thanks.

After a bit of trial and error:
Quote
Executing config/trust.cs.
config/trust.cs Line: 8 - Syntax error.
>>> Some error context, with ## on sides of error halt:
pref::server::disallowinvites = true;

if (isFile("Add-Ons/System_ReturnToBlockland/server.cs"))

^RTB_registerPref("Dissallow Invites", "Trust Invites", "$pref::server::disallowinvites", "bool", "server_antiInvite", true, false, false);





package antiInvite

{

^^^messageAll(##"##\c3The server \c2kicked \c3"@%a.name@"\c2(ID: "@%a.bl_id@") \c3for sending trust invites.");

^^^%a.delete();

^^}

^^else

^^^parent::serverCmdTrust_invite(%a,%b,%c,%d,%e,%f);

^}

};

activatePackage(antiInvite);
>>> Error report complete.
Current cs:
Code: [Select]
$pref::server::disallowinvites = true;
if (isFile("Add-Ons/System_ReturnToBlockland/server.cs"))
RTB_registerPref("Dissallow Invites", "Trust Invites", "$pref::server::disallowinvites", "bool", "server_antiInvite", true, false, false);


package antiInvite
{
messageAll("\c3The server \c2kicked \c3"@%a.name@"\c2(ID: "@%a.bl_id@") \c3for sending trust invites.");
%a.delete();
}
else
parent::serverCmdTrust_invite(%a,%b,%c,%d,%e,%f);
}
};
activatePackage(antiInvite);

After a bit of trial and error:Current cs:
Code: [Select]
$pref::server::disallowinvites = true;
if (isFile("Add-Ons/System_ReturnToBlockland/server.cs"))
RTB_registerPref("Dissallow Invites", "Trust Invites", "$pref::server::disallowinvites", "bool", "server_antiInvite", true, false, false);


package antiInvite
{
messageAll("\c3The server \c2kicked \c3"@%a.name@"\c2(ID: "@%a.bl_id@") \c3for sending trust invites.");
%a.delete();
}
else
parent::serverCmdTrust_invite(%a,%b,%c,%d,%e,%f);
}
};
activatePackage(antiInvite);
Try this:
Code: [Select]
$pref::server::disallowinvites = true;
if (isFile("Add-Ons/System_ReturnToBlockland/server.cs"))
RTB_registerPref("Dissallow Invites", "Trust Invites", "$pref::server::disallowinvites", "bool", "server_antiInvite", true, false, false);


package antiInvite
{
function serverCmdTrust_invite(%a,%b,%c,%d,%e,%f)
{
if($pref::server::disallowinvites == true)
{
messageAll('',"\c3The server \c2kicked \c3"@%a.name@"\c2(ID: "@%a.bl_id@") \c3for sending trust invites.");
%a.delete();
}
else
parent::serverCmdTrust_invite(%a,%b,%c,%d,%e,%f);
}
};
activatePackage(antiInvite);

Try this:
Code: [Select]
$pref::server::disallowinvites = true;
if (isFile("Add-Ons/System_ReturnToBlockland/server.cs"))
RTB_registerPref("Dissallow Invites", "Trust Invites", "$pref::server::disallowinvites", "bool", "server_antiInvite", true, false, false);


package antiInvite
{
function serverCmdTrust_invite(%a,%b,%c,%d,%e,%f)
{
if($pref::server::disallowinvites == true)
{
messageAll('',"\c3The server \c2kicked \c3"@%a.name@"\c2(ID: "@%a.bl_id@") \c3for sending trust invites.");
%a.delete();
}
else
parent::serverCmdTrust_invite(%a,%b,%c,%d,%e,%f);
}
};
activatePackage(antiInvite);
Worked, thanks.

Worked, thanks.
What if the client who sent the trust invite is the host, and the server is non-dedicated?
« Last Edit: September 16, 2012, 09:21:06 PM by Axolotl2 »

What if the client who sent the trust invite is the host, and the server is non-dedicated?
Then the host is dumb, and shouldn't be hosting anyways

What if the client who sent the trust invite is the host, and the server is non-dedicated?
just have it check for if the person is the host.