Current Code:
function getRandomString(%len)
{
%chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890";
for(%i=0;%i<%len;%i++)
{
%str = %str @ getSubStr(%chars,getRandom(0,strlen(%chars)-1),1);
}
return %str;
}
function servercmdrandomizepasswords(%client,%alen,%salen)
{
//This is not for use on LAN servers,
//how do I check that?
if(what)
{
messageClient(%client,"\c6Sorry, but \c3/RandomizePasswords\c6 is only available on non-LAN servers only.");
}
else
{
if(%client.getName() $= "LocalClientConnection" || getNumKeyID() == %client.bl_id)
{
$Pref::Server::AdminPassword = getRandomString(%alen);
$Pref::Server::SuperAdminPassword = getRandomString(%salen);
for(%i=0;%i<ClientGroup.getCount();%i++)
{
%cl = ClientGroup.getObject(%i);
if(%cl.isAdmin)
{
messageClient(%cl,'',"\c6The admin password is now \c2" @ $Pref::Server::AdminPassword @ "\c6.);
if(%cl.isSuperAdmin)
{
messageClient(%cl,'',"\c6The super admin password is now \c3" @ $Pref::Server::SuperAdminPassword @ "\6.);
}
}
}
}
else
{
messageClient(%client,"\c6Sorry, but \c3/RandomizePasswords\c6 is host only.");
}
}
The question is in the code.
Without wax,
Tickle.