Official Soldat Forums
Server Talk => Scripting Discussions and Help => Topic started 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
-
Wrong section...... Newbies these days. Cant read anything.
-
>:(
-
>:(
Hey, no single letter or emoticon posts.
-
Yah ok fine
-
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:
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;
-
Ok it dident work i got the message
- [Error] (72:1): Semicolon (';') expected
-
my bad, replace the " BotName = 'Billy'" line with " BotName = 'Billy';"
-
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:.>
-
do you want the message to only be said to the joining player?
procedure OnJoinGame(ID, Team: byte);
begin
SayToPlayer(ID,'<.:Bot Attack:.>');
end;
or to everybody?
procedure OnJoinGame(ID, Team: byte);
begin
Command('/say <.:Bot Attack:.>');
end;
-
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
-
i added the line that says the bot attack thing
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;
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 ^^