Official Soldat Forums

Server Talk => Scripting Discussions and Help => Topic started by: Tosty on August 02, 2007, 11:21:17 pm

Title: Randome spawn
Post by: Tosty on August 02, 2007, 11:21:17 pm
I'm looking for a script thet will automaticly put a randome # of bots in the game every 4-7 minutes....

anyone got one  ???

Date Posted: August 02, 2007, 11:50:55 PM
Also i woul like an unlocker

(after # of points dif spawn commands are unlocked for these spawns



Result := false;
   Case Text of
      '/deagles': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),1);
      '/hkmp5': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),2);
      '/ak74': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),3);
      '/steyr': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),4);
      '/spaz': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),5);
      '/ruger': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),6);
      '/m79': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),7);
      '/barret': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),8);
      '/minimi': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),9);
      '/minigun': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),10);
      '/socom': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),11);
      '/knife': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),12);
      '/saw': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),13);
      '/law': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),14);
      '/stat': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),15);
      '/medic': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),16);
      '/nade': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),17);
      '/god': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),18);
      '/armor': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),19);
      '/pred': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),20);
      '/berserk': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),21);
      '/cluster': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),22);
      '/commands': begin
         WriteConsole(ID,'Commands: /deagles /hkmp5 /ak74 /steyr /spaz /ruger /m79 /barret /minimi /minigun',$EE81FAA1);
         WriteConsole(ID,'/socom /knife /saw /law /stat',$EE81FAA1);
         WriteConsole(ID,'/medic /nade /god /armor /pred /berserk /cluster',$EE81FAA1);
      end;

Preferably a new one every 5 points and god is hidden till 100 points
Title: Re: Randome spawn
Post by: EnEsCe on August 03, 2007, 08:49:10 pm
Wrong section...... Newbies these days. Cant read anything.
Title: Re: Randome spawn
Post by: Tosty on August 03, 2007, 10:30:48 pm
 >:(
Title: Re: Randome spawn
Post by: Xxypher on August 03, 2007, 11:35:06 pm
>:(
Hey, no single letter or emoticon posts.
Title: Re: Randome spawn
Post by: Tosty on August 04, 2007, 02:56:23 am
Yah ok fine
Title: Re: Randome spawn
Post by: DorkeyDear on August 04, 2007, 11:06:01 am
I'm looking for a script thet will automaticly put a randome # of bots in the game every 4-7 minutes....

Well, uhh... I just threw this together:
Code: [Select]
const
  BotName = 'Billy';
  BotTeam = 0;

var
  Time: integer;

procedure ActivateServer();
begin
  Time := Random(4,7);
end;

procedure AppOnIdle(Ticks: integer);
var
  i: byte;
begin
  if Ticks mod (60 * 60 * Time) = 0 then begin
    for i := 1 to 32 do if (GetPlayerStat(i,'Human') = false) and (GetPlayerStat(i,'Name') = BotName) then Command('/kick ' + InttoStr(i));
    for i := 1 to Random(1,10) do Command('/addbot' + InttoStr(BotTeam) + BotName);
    Time := Random(4,7);
  end;
end;
Title: Re: Randome spawn
Post by: Tosty on August 04, 2007, 09:25:04 pm
Ok it dident work i got the message

Title: Re: Randome spawn
Post by: DorkeyDear on August 04, 2007, 11:07:42 pm
my bad, replace the "  BotName = 'Billy'" line with "  BotName = 'Billy';"
Title: Re: Randome spawn
Post by: Tosty on August 05, 2007, 12:19:21 am
ok i did that and now it said

[error] (77:11) : duplicate identifier 'ActivateServer'

Date Posted: August 05, 2007, 12:03:16 AM
I got it to work

Date Posted: August 05, 2007, 12:06:58 AM
ok is there a way to make a msg appere when they join the game

somthing like

<.:Bot Attack:.>
Title: Re: Randome spawn
Post by: DorkeyDear on August 05, 2007, 01:50:56 pm
do you want the message to only be said to the joining player?
Code: [Select]
procedure OnJoinGame(ID, Team: byte);
begin
  SayToPlayer(ID,'<.:Bot Attack:.>');
end;
or to everybody?
Code: [Select]
procedure OnJoinGame(ID, Team: byte);
begin
  Command('/say <.:Bot Attack:.>');
end;
Title: Re: Randome spawn
Post by: Tosty on August 05, 2007, 06:30:45 pm
i ment when the bots start joining the game

Date Posted: August 05, 2007, 05:48:50 PM
LIke when they start to join it will say <.:bot atack:.>

Date Posted: August 05, 2007, 05:50:12 PM
the script doesnt kick the bots so there is a masiv bot backup and my server lagss bad can you fix it so it kicks the bots when there time is up
Title: Re: Randome spawn
Post by: DorkeyDear on August 05, 2007, 07:29:40 pm
i added the line that says the bot attack thing
Code: [Select]
const
  BotName = 'Billy';
  BotTeam = 0;

var
  Time: integer;

procedure ActivateServer();
begin
  Time := Random(4,7);
end;

procedure AppOnIdle(Ticks: integer);
var
  i: byte;
begin
  if Ticks mod (60 * 60 * Time) = 0 then begin
    for i := 1 to 32 do if (GetPlayerStat(i,'Human') = false) and (GetPlayerStat(i,'Name') = BotName) then Command('/kick ' + InttoStr(i));
    for i := 1 to Random(1,10) do Command('/addbot' + InttoStr(BotTeam) + BotName);
    Command('/say <.:Bot Attack:.>');
    Time := Random(4,7);
  end;
end;
Quote

and im too lazy to make it so it doesn't kick all the bots.. if ur server can't stand it, you should get a new 1, unless this is hosted off ur home computer, then you should just... uh... i don't know ^^