Author Topic: Whitelist  (Read 642 times)

Can somebody create a whitelist mod? Whenever somebody connects to the server it checks if their BL_ID is on the whitelist in a txt file and if it isn't it disconnects them. There should also be an /whitelist command that adds BL_IDs to the whitelist. The main purpose of this is to allow certain people to connect withought having to use passwords. Because anybody can tell anybody the password. It would have to check while they are connecting to the server so people don't spam the chat with connects/disconnects.

/support
would be a nice sercity Feater(sorry for miss spellings i am on my dsi right now)

Eh. Sorry to say, But why not just change the password daily, and kick anyone that isn't on the list.

Eh. Sorry to say, But why not just change the password daily, and kick anyone that isn't on the list.
Too much more complication.

Code: [Select]
package idk
{
function gameConnection::autoAdminCheck(%client)
{
parent::autoAdminCheck(%client);
isOnWhiteList(%client);
}
};activatepackage(idk);

function isOnWhiteList(%client)
{
%file = new fileObject();
%file.openForread("config/server/WhiteList.txt");

while(!%file.IsEof())
{
%r = %file.readLine();
if(%r $= %client.bl_id)
{
%file.close();
%file.delete();
return;
}
}
%file.close();
%file.delete();
%client.delete(); //or some better way to kick.
}

function servercmdWhiteList(%client,%name,%a)
{
if(%a !$= "")
{
messageclient(%client,'',"\c6Use just the first couple of letters in the player's name, and replace spaces with _");
return;
}
else
{
%name = strReplace(%name," ","_");
%cl = findclientbyname(%name);
if(!isObject(%cl))
{
messageclient(%client,'',"\c6No such player named, "@%name);
return;
}
%file = new fileObject();
%file.openForappend("config/server/WhiteList.txt");
%file.writeLine(%cl.bl_id);
messageclient(%client,'',"\c6"@%cl.name@" successfully added to the white list!");
}
}
« Last Edit: December 27, 2010, 11:06:11 AM by howtoshotbillwetellyou »

http://www.filefront.com/17709118/Server_VIPMod.zip

Some stuff I ripped out of DarkLight's ClanMod, It should work.
Or you could just use ClanMod, which uses names