Script Name: Password Reseter
Script Description: When the last player leaves, the password resets to whatever the default password is normally set to. There is only one unfixable bug that when a player /recompiles, the password is reset to whatever is set in soldat.ini instead of whatever "soldat.ini" the player has chosen to use. The only way to fix this is by getting rid of the part that auto-detects what the server password "should" be when the server first starts.
Original Author: Curt
Core Version: 2.6.2
Code: var
DPass: string;
procedure ActivateServer();
begin
DPass := ReadINI('soldat.ini','NETWORK','Game_Password','');
end;
function OnCommand(ID: Byte; Text: string): boolean;
begin
Result := false;
if GetPiece(Text,' ',0) = '/loadcon' then DPass := ReadINI(Copy(Text,10,Length(Text)),'NETWORK','Game_Password',DPass);
end;
procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);
begin
if NumPlayers = 1 then Command('/password ' + DPass);
end;
In request for a fix from Dizzy So 1337.
Question: If an admin does "/loadcon" just as it is, does it load soldat.ini or the most recently loaded .ini file?