Author Topic: Survival enable/disable check  (Read 642 times)

0 Members and 1 Guest are viewing this topic.

Offline Beowulf Agate

  • Major
  • *
  • Posts: 73
Survival enable/disable check
« on: October 02, 2009, 01:15:58 pm »
Is there a possibility to check if survival mode is enabled/disabled, becouse i  need a script which checks that and then performs or not a few commands. I searched Soldat Server Scripting Manual and found nothin'. Please help.

Offline Serial K!ller

  • Camper
  • ***
  • Posts: 408
    • Soldat Mods Archive
Re: Survival enable/disable check
« Reply #1 on: October 02, 2009, 01:42:06 pm »
Yes you can.
Using command Command('/survival') = 1/0

It gives a line on console so I only check it on ActivateServer() and OnMapchange() (for when someone does /survival 0/1)

Code: (pascal) [Select]
if (Command('/survival') = 1) then begin
SurvivalmodeOn  :=  true;
end
else begin
SurvivalmodeOn  :=  false;
end;

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Survival enable/disable check
« Reply #2 on: October 02, 2009, 03:29:25 pm »
Another way to make it more 'hidden' is:
Code: [Select]
function SurvivalModeState: boolean;
begin
  Result := Command('/survival') = 1;
end;
Same thing can be applied with any command similar to this.. /realistic for example would work just as well.