Author Topic: Please say me, how do i put the scripts in my Soldat Server?  (Read 2299 times)

0 Members and 1 Guest are viewing this topic.

Offline Titus

  • Major(1)
  • Posts: 3
Please say me, how do i put the scripts in my Soldat Server?
« on: January 13, 2007, 06:39:57 pm »
Hello,
im new to soldatforums. i have question, that i did not found here.
i have the uptime script here:
Code: [Select]
const
  ADMIN_UPTIME_ON=1; //turns off/on /uptime script
  PLAYER_UPTIME_ON=1; //turns off/on !uptime script

var
  up: integer;

procedure ActivateServer();
begin
  up:=0;
end;

procedure AppOnIdle(Ticks: integer);
begin
  up:=up+1;
end;

function formatTime():string;
var d,h,m,s: integer;
begin
  d:= up/86400;
  h:= up/3600 mod 24;
  m:= up/60 mod 60;
  s:= up mod 60;

  if((d=0) and (h=0)) then begin result:=inttostr(m)+'m:'+inttostr(s)+'s'; end
    else if d=0 then begin result:=inttostr(h)+'h:'+inttostr(m)+'m:'+inttostr(s)+'s'; end
      else result:=inttostr(d)+'d:'+inttostr(h)+'h:'+inttostr(m)+'m:'+inttostr(s)+'s';
end;

procedure OnPlayerSpeak(Name,Text: string);
begin
if((Text='!uptime')and(PLAYER_UPTIME_ON=1)) then begin
   saytoplayer(NametoID(Name),'server is running for: '+formatTime());
end;
end;

procedure OnCommand(ID: integer;Text: string);
begin
  if((Text='/uptime')and(ADMIN_UPTIME_ON=1)) then begin
    saytoplayer(ID,'server is running for: '+formatTime());
  end;
end;



but how do i integrate it to my soldat server? i did not found a solution for that :(

Thank you!! :)

Regards Titus
« Last Edit: January 13, 2007, 07:21:36 pm by FliesLikeABrick »

Offline FliesLikeABrick

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 6144
    • Ultimate 13 Soldat
Re: Please say me, how do i put the scripts in my Soldat Server?
« Reply #1 on: January 13, 2007, 07:19:45 pm »
please use the code tags when posting code (I've added them to your post for you)
« Last Edit: January 13, 2007, 07:21:46 pm by FliesLikeABrick »

Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: Please say me, how do i put the scripts in my Soldat Server?
« Reply #2 on: January 14, 2007, 03:20:15 am »
Either edit the apropriate files in the scripts directory to include that code, or delete the affected procedures, put it in a new file, and add it to the script list.

I'd recommend the latter; so delete the ActivateServer, AppOnIdle, and OnCommand procedures from Core.pas, and delete OnPlayerSpeak from NetworkCore.pas, create a new file (uptime.pas), save it in the same directory, and add uptime.pas to includes.txt

Offline Titus

  • Major(1)
  • Posts: 3
Re: Please say me, how do i put the scripts in my Soldat Server?
« Reply #3 on: January 14, 2007, 11:22:16 am »
Thank you for your help :)
I understood it, and put already 2 scripts on my server :)


Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: Please say me, how do i put the scripts in my Soldat Server?
« Reply #4 on: January 14, 2007, 11:34:50 pm »
Ensure that when you use multiple scripts, you follow the guide to combining scripts.

Offline Snipufin

  • Camper
  • ***
  • Posts: 281
Re: Please say me, how do i put the scripts in my Soldat Server?
« Reply #5 on: January 18, 2007, 02:55:11 pm »
Either edit the apropriate files in the scripts directory to include that code, or delete the affected procedures, put it in a new file, and add it to the script list.

I'd recommend the latter; so delete the ActivateServer, AppOnIdle, and OnCommand procedures from Core.pas, and delete OnPlayerSpeak from NetworkCore.pas, create a new file (uptime.pas), save it in the same directory, and add uptime.pas to includes.txt
Wow, I had the same question, but I didn't understand that answer.
Quote
Name:     Snipufin
Posts:    111 (1.11 per day)
Position:    Soldier
Karma:    -11

Offline M.rSnow

  • Camper
  • ***
  • Posts: 482
Re: Please say me, how do i put the scripts in my Soldat Server?
« Reply #6 on: February 02, 2007, 07:22:30 pm »
Fast questing (yes or no question not worth creating a tread for).
Are it possible to play an non-dedicated server whit scripts?
(if yes please PM how)
Btw lock this tread. Think the question are awnserd.
Lapis: You need a vacation or a bullet though the head both works just fine by me.