Author Topic: Using scripts on server  (Read 832 times)

0 Members and 1 Guest are viewing this topic.

Offline recruit

  • Soldier
  • **
  • Posts: 117
Using scripts on server
« on: September 04, 2007, 09:04:09 am »
anyone here can give me some help?
Need latest dedicated server right? got that
Need to combine the default script right? did that
Now how do you use scripts like Trenchwar domination or ANY SCRIPTS FOR THAT MATTER
...
working

Offline -Major-

  • Veteran
  • *****
  • Posts: 1419
Re: Using scripts on server
« Reply #1 on: September 04, 2007, 12:21:05 pm »
Code: [Select]
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
end;

this is one procedure in the script you have in scripts.pas.

Code: [Select]
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
  If GetPlayerStat(Killer,'Team') <> GetPlayerStat(Victim,'Team') then begin
    If (KillsPerMine > 0) and mines then begin
      soldier[Killer] := soldier[Killer] + 1;
      If soldier[Killer] mod KillsPerMine = 0 then
        WriteConsole(Killer,'You may now place up to ' + inttostr(soldier[Killer] div KillsPerMine) + ' mines (/mine)',cMine);
    end;
  end;
end;

now this is a part of the scripts in trenchwar dominating script.

the procedure is OnPlayerKill. so just copy the content in "OnPlayerKill"

copy this:
 
Code: [Select]
If GetPlayerStat(Killer,'Team') <> GetPlayerStat(Victim,'Team') then begin
    If (KillsPerMine > 0) and mines then begin
      soldier[Killer] := soldier[Killer] + 1;
      If soldier[Killer] mod KillsPerMine = 0 then
        WriteConsole(Killer,'You may now place up to ' + inttostr(soldier[Killer] div KillsPerMine) + ' mines (/mine)',cMine);
    end;
  end;

and paste it betwen:

Code: [Select]
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
and (Paste here)
Code: [Select]
end;
note that you can only have one unique procedure so you cant have two OnPlayerKill procedures. now I see there is a few procedures that doesnt excist in the scripts.pas. simply add them.

Code: [Select]
{$VERSION 2.6.0}
const
//Teams
  ALPHA = 1;
  BRAVO = 2;
  CHARLIE = 3;
  DELTA = 4;
  SPECTATOR = 5;
//Game Modes
  DEATHMATCH = 0;
  POINTMATCH = 1;
  TEAMMATCH = 2;
  CTF = 3;
  RAMBO = 4;
  INF = 5;
  HTF = 6;
//Weapons
  DEAGLES = 1;
  HKMP5 = 2;
  AK74 = 3;
  STEYR = 4;
  SPAS = 5;
  RUGER = 6;
  M79 = 7;
  BARRET = 8;
  MINIMI = 9;
  MINIGUN = 10;
  FLAMER = 11;
  BOW = 12;
  FLAMEBOW = 13;
  SOCOM = 0;
  KNIFE = 14;
  CHAINSAW = 15;
  LAW = 16;

this shall not be added twice.

if I am wrong please tell me.

Offline Leo

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1011
Re: Using scripts on server
« Reply #2 on: September 04, 2007, 01:19:32 pm »
.... You don't need to combine scripts anymore. Just make a folder for every script in the "scripts" folder of the dedicated server and have an "Includes.txt" with the name of the script. That's all.

Offline -Major-

  • Veteran
  • *****
  • Posts: 1419
Re: Using scripts on server
« Reply #3 on: September 05, 2007, 01:02:53 am »
hmm won't this take unnecessary resources?

Offline recruit

  • Soldier
  • **
  • Posts: 117
Re: Using scripts on server
« Reply #4 on: September 05, 2007, 03:02:11 am »
it still doesn't works i dont get any mines with the trenchwardomination script

Date Posted: September 05, 2007, 03:50:24 AM
could someone give me a directory?
soldat/scripts
     ----->Default files/(default stuff)
     ----->TrenchwarDomination
so where do I put the includes file?