I'm posting the code incase some other people may want it. Just make sure you give credit where it is due.
//Comchat.cs
//You know where this goes
if(%w1 == "#login"){
%c1 = GetWord(%cropped, 0);
%pw = fetchData(%TrueClientId, "password");
if(fetchData(%TrueClientId, "HasLoadedAndSpawned"))
return;
else{
if(%c1 == %pw){
Client::sendMessage(%TrueClientId, 0, Password accepted. Logging in now.");
Game::playerSpawn(%TrueClientId, false);
}
else
Client::sendMessage(%TrueClientId, 0, Login Failed. Invalid Password.");
}
return;
}
//Connectivity.cs
//Ahh yes.. The fun part!
//if($Client::info[%clientId, 5] == "") Comment this if statement out, because we want them to be able to join if there is nothing in "Other Info"
//if(fetchData(%clientId, "password") Comment this one out too.. We aren't running checks in the "Other Info" field.
//Replace the statements directly under the comments "Everything went fine. Spawn the player."
%name = Client::getName(%clientId);
%filename = %name @ ".cs";
if(!isFile("temp\\" @ %filename)){
if(%clientId.choosingGroup)
StartStatSelection(%clientId);
}
else{
Client::setControlObject(%clientId, Client::getObserverCamera(%clientId));
%camSpawn = Game::pickObserverSpawn(%clientId);
Observer::setFlyMode(%clientId, GameBase::getPosition(%camSpawn), GameBase::getRotation(%camSpawn), false, false);
Centerprint(%clientId, "Please login by typing #login password", 10);
}
This hasn't been tested, but should work with no problems. There may be a slight error with new characters, let me know if it is so. If you don't know where to put everything, don't bother trying.
Oh.. And to fix the problem with people blurting out their passwords..
in remotesay()
if(!fetchData(%ClientId, "HasLoadedAndSpawned"))
return;