Official Soldat Forums

Server Talk => Scripting Discussions and Help => Topic started by: mich1103 on February 06, 2010, 01:48:56 pm

Title: What is wrong ?
Post by: mich1103 on February 06, 2010, 01:48:56 pm
if (NumPlayers=1) then
begin
    if (AlphaPlayers=1) then Command('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Slicer Zombie')
                                                  ('/addbot2 Burning Zombie')
                                                  ('/addbot2 Taliban')
                                                  end;
if (NumPlayers=2) then
begin
    if (AlphaPlayers=2) then Command('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Slicer Zombie')
                                                  ('/addbot2 Burning Zombie')
                                                  ('/addbot2 Taliban')
                                                  ('/addbot2 Serker Zombie')
                                                  end;

//////////////////////////////////////////////////////////////////////////////////
WHAT'S WRONG ??? ??? ??? ???
                                         
Title: Re: What is wrong ?
Post by: Horve on February 06, 2010, 02:01:20 pm
NumPlayers = players and bots together
try (NumPlayers - NumBots) in stead of just NumPlayers

and I'm not sure, but doesn't command already do >> /  << at the beginning?
Title: Re: What is wrong ?
Post by: croat1gamer on February 06, 2010, 02:11:36 pm
Uhh, you didnt specify the procedure.

Please, take a look at some other scripts to see how should the syntax should look.
Title: Re: What is wrong ?
Post by: mich1103 on February 06, 2010, 02:15:47 pm
can you make my script work please ????

do i need to do that ? :

///////////////////////////////////////////////////////////////////
procedure ActivateServer();
begin
if (NumPlayers=1) then
begin
    if (AlphaPlayers=1) then Command('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Slicer Zombie')
                                                  ('/addbot2 Burning Zombie')
                                                  ('/addbot2 Taliban')
                                                  end;
if (NumPlayers=2) then
begin
    if (AlphaPlayers=2) then Command('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Slicer Zombie')
                                                  ('/addbot2 Burning Zombie')
                                                  ('/addbot2 Taliban')
                                                  ('/addbot2 Serker Zombie')
                                                  end;
/////////////////////////////////////////////////////////////////////////
Title: Re: What is wrong ?
Post by: croat1gamer on February 06, 2010, 02:43:49 pm
READ THIS: http://enesce.com/help/
THE DESCRIPTIONS
Title: Re: What is wrong ?
Post by: mich1103 on February 06, 2010, 02:53:52 pm
why that's dont work :

procedure OnJoinGame(ID, Team: byte)
begin
if (NumPlayers=1) then
begin
    if (AlphaPlayers=1) then Command('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Slicer Zombie')
                                                  ('/addbot2 Burning Zombie')
                                                  ('/addbot2 Taliban')
                                                  end;
if (NumPlayers=2) then
begin
    if (AlphaPlayers=2) then Command('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Zombie')
                                                  ('/addbot2 Slicer Zombie')
                                                  ('/addbot2 Burning Zombie')
                                                  ('/addbot2 Taliban')
                                                  ('/addbot2 Serker Zombie')
Title: Re: What is wrong ?
Post by: y0uRd34th on February 06, 2010, 03:00:36 pm
Omfg, maybe because you do not read other peoples posts?
Go and learn scripting slowly, with little parts, like when a player types /lol it says "Swompie laughing out loud! LOL!".
Also use this button (http://static.forums.soldat.pl/Themes/sfv2/images/bbc/code.gif)for codes.
Title: Re: What is wrong ?
Post by: croat1gamer on February 06, 2010, 03:04:46 pm
DESCRIPTIONS FOR F**K SAKE

READ THEM

Just do it with
Code: [Select]
procedure OnJoinTeam(ID, Team: byte)
begin

if (AlphaPlayers=1) then
   begin
Command('/addbot2 Zombie');
Command('/addbot2 Zombie');
Command('/addbot2 Zombie');
Command('/addbot2 Zombie');
Command('/addbot2 Zombie');
Command('/addbot2 Slicer Zombie');
Command('/addbot2 Burning Zombie');
Command('/addbot2 Taliban');
end;

if (AlphaPlayers=2) then
   begin
Command('/addbot2 Zombie');
Command('/addbot2 Zombie');
Command('/addbot2 Zombie');
Command('/addbot2 Zombie');
Command('/addbot2 Zombie');
Command('/addbot2 Slicer Zombie');
Command('/addbot2 Burning Zombie');
Command('/addbot2 Taliban');
end;

end;

This is the last time i will edit your scripts, i swear to god with that.
Title: Re: What is wrong ?
Post by: mich1103 on February 06, 2010, 04:44:12 pm
thanks man   ;D 
i will try to learn pascal




is not to be bad with you but the script you have post doesn't work too.

i put OnScriptCrash:1

and when i start my server with this script my server automaticly shutdown ...




Title: Re: What is wrong ?
Post by: VinceBros on February 06, 2010, 05:25:13 pm
Try this
Code: (pascal) [Select]
procedure OnJoinTeam(ID, Team: byte);
begin

if (AlphaPlayers=1) then
   begin
Command('/addbot2 Zombie');
Command('/addbot2 Zombie');
Command('/addbot2 Zombie');
Command('/addbot2 Zombie');
Command('/addbot2 Zombie');
Command('/addbot2 Slicer Zombie');
Command('/addbot2 Burning Zombie');
Command('/addbot2 Taliban');
end;

if (AlphaPlayers=2) then
   begin
Command('/addbot2 Zombie');
Command('/addbot2 Zombie');
Command('/addbot2 Zombie');
Command('/addbot2 Zombie');
Command('/addbot2 Zombie');
Command('/addbot2 Slicer Zombie');
Command('/addbot2 Burning Zombie');
Command('/addbot2 Taliban');
end;

end;

He forgot a semicolon after OnJoinTeam.
Title: Re: What is wrong ?
Post by: mich1103 on February 06, 2010, 05:49:53 pm
that's dont work too
my server shut down automatibly whne i start my server
Title: Re: What is wrong ?
Post by: Gizd on February 06, 2010, 06:33:11 pm
i put OnScriptCrash:1
If you mean the OnScriptCrash from server.ini, it's values are "ignore", "shutdown" and "recompile" as far as I know.
Title: Re: What is wrong ?
Post by: mich1103 on February 06, 2010, 07:38:33 pm
euuhhhh i dont understand


i just want to know why the script dont work .
Title: Re: What is wrong ?
Post by: croat1gamer on February 06, 2010, 07:53:06 pm
He forgot a semicolon after OnJoinTeam.
My bad.

Use what vince wrote, make sure that THIS script is the problem cause.
Title: Re: What is wrong ?
Post by: mich1103 on February 06, 2010, 08:02:07 pm
doesn't work too


i use the script of VinceBros
and that's dont work
Title: Re: What is wrong ?
Post by: croat1gamer on February 06, 2010, 08:17:20 pm
Make sure that THIS script is the cause for the problem.

What do the logs say?
Title: Re: What is wrong ?
Post by: mich1103 on February 06, 2010, 08:22:26 pm
I found it :
 :o  :o  :o  :o  :o


10-02-06 20:20:02    Console Log Started
10-02-06 20:20:02 Loaded weapons mod "Default mod v1.5"
10-02-06 20:20:02 Welcome to Soldat 1.5.0
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 
10-02-06 20:20:02 Shutting down server...
10-02-06 20:20:02 Shutting down admin server...
10-02-06 20:20:02 Shutting down ScriptCore...


Compiling autobot -> ab.pas...
10-02-06 20:20:02 
autobot -> [Error] (2:1): 'BEGIN' expected
Title: Re: What is wrong ?
Post by: croat1gamer on February 06, 2010, 10:04:12 pm
Your autobot script is doing the problem.
Title: Re: What is wrong ?
Post by: Horve on February 06, 2010, 11:43:51 pm
in your autobot script, the error is in the very first line. The script wants you to include begin somewhere, as you don't have it typed.
Title: Re: What is wrong ?
Post by: croat1gamer on February 07, 2010, 05:51:10 am
The problem is obviously like in his zombie adding script, as he cant write the syntax properly.
Title: Re: What is wrong ?
Post by: mich1103 on February 07, 2010, 07:22:30 am
whaaaaaaat   
the includes is the problem?


Title: Re: What is wrong ?
Post by: croat1gamer on February 07, 2010, 07:23:42 am
Compiling autobot -> ab.pas...
10-02-06 20:20:02
autobot -> [Error]

THIS SCRIPT IS THE PROBLEM
Title: Re: What is wrong ?
Post by: mich1103 on February 07, 2010, 07:26:23 am
i know but how i make this script working
Title: Re: What is wrong ?
Post by: croat1gamer on February 07, 2010, 07:33:57 am
Learn how to write scripts properly?
Title: Re: What is wrong ?
Post by: mich1103 on February 07, 2010, 07:39:06 am
yesterday i verefy
procedureOnJoinTeam(ID, Team: byte); 
and that's right i verefy in your enesce manual...

you've say that was the last time i will edit script for you and the script was supposed to work or not ???

 
IT IS SO DIFFICULT to say what is wrong ???????
Title: Re: What is wrong ?
Post by: Gizd on February 07, 2010, 09:30:11 am
procedure OnJoinTeam(ID, Team: byte);
Title: Re: What is wrong ?
Post by: mich1103 on February 07, 2010, 10:29:40 am
OK if that is wrong :
procedure OnJoinTeam(ID, Team: byte);

what i need to put
??? ??? ??? ???
Title: Re: What is wrong ?
Post by: dnmr on February 07, 2010, 10:54:22 am
you were missing a space
Title: Re: What is wrong ?
Post by: mich1103 on February 07, 2010, 11:16:31 am
i miss a space ?
where ?

From: February 07, 2010, 11:37:38 am
when a player join,my script add auto the bot but doesn't remove when he quit
do i need to use procedure OnLeaveGame(ID, Team: byte;Kicked: boolean);

then begin ...
then Command('/kick Zombie....

like that ??? or not ???
Title: Re: What is wrong ?
Post by: croat1gamer on February 07, 2010, 11:40:06 am
I made it extra noticeable:
(http://i46.tinypic.com/2myw7jt.jpg)
Title: Re: What is wrong ?
Post by: Gizd on February 07, 2010, 11:59:39 am
OnJoinTeam/OnLeaveGame is what is called when someone joins/leaves game. If you want to balance bots depending on player count you need to add them when someone joins and kick when he leaves. I bet you won't understand but it's good to try.
Title: Re: What is wrong ?
Post by: mich1103 on February 07, 2010, 11:59:54 am
omg i know
the script work correcly
but i want when the player leave that kick the bot who have been adding when he have join.


*****************
I dont talk to you Gizd
*****************
ok Gizd can you give me an example for when the player leave that kick the bot who have been added when he have join
Title: Re: What is wrong ?
Post by: y0uRd34th on February 07, 2010, 12:17:42 pm
I am sorry, but LOOL!!!

mich1103, try to start with VERY simple scripts, instead of posting thousands of questions, when you try little things, and you have problems, then create a topic, name it like "I am learning scripting" and post all your questions in there, thx.

Here an example what i mean with "VERY simple":
Code: [Select]
function OnPlayerCommand(ID: byte; Text: string): boolean;
begin

  Result := false;

  if Text = '/lol' then
    WriteConsole(0, IDToName(ID) + ' is laughing out loud!! XD LOL?!?', $FFFF00);

end;

I hope you understand what i mean, try it step by step, always a bit harder..
Title: Re: What is wrong ?
Post by: mich1103 on February 07, 2010, 12:32:45 pm
i can do this simple script that's very easier
i do step by step and now im here to complete the script we have do.
Now the script work but i just want when the player leave the game that kick the zombie he have added whan i have join.

so i think i need to use that :

procedure OnLeaveGame(ID, Team: byte;Kicked: boolean);
begin
if (THERE IS THE PROBLEM,i want a leave... thing)
Title: Re: What is wrong ?
Post by: Gizd on February 08, 2010, 09:56:41 am
Let me kill this thread once and for all...
Code: [Select]
const
  BotsPerPlayer = x; // bots added per player
  MaxPlayers2 = y; // max players on server

var
  Bot: array[1..MaxPlayers2] of array[1..BotsPerPlayer] of byte;
  i, j: byte;

procedure OnJoinGame(ID,Team: byte);
begin
  for i:= 1 to MaxPlayers2 do if Bot[i][1] = 0 then begin
    Bot[i][1]:= Command('/addbot2 Zombie');
    ...  // here go commands adding bots
    Bot[i][BotsPerPlayer]:= Command('/addbot2 Zombie');
    break;
  end;
end;

procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);
begin
  for i:= 1 to MaxPlayers2 do if Bot[i][1] > 0 then begin
    for j:= 1 to BotsPerPlayer do begin
      KickPlayer(Bot[i][j]);
      Bot[i][j]:= 0;
    end;
    break;
  end;
end;