Official Soldat Forums
Server Talk => Scripting Discussions and Help => Topic started 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 ??? ??? ??? ???
-
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?
-
Uhh, you didnt specify the procedure.
Please, take a look at some other scripts to see how should the syntax should look.
-
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;
/////////////////////////////////////////////////////////////////////////
-
READ THIS: http://enesce.com/help/
THE DESCRIPTIONS
-
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')
-
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.
-
DESCRIPTIONS FOR F**K SAKE
READ THEM
Just do it with
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.
-
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 ...
-
Try this
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.
-
that's dont work too
my server shut down automatibly whne i start my server
-
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.
-
euuhhhh i dont understand
i just want to know why the script dont work .
-
He forgot a semicolon after OnJoinTeam.
My bad.
Use what vince wrote, make sure that THIS script is the problem cause.
-
doesn't work too
i use the script of VinceBros
and that's dont work
-
Make sure that THIS script is the cause for the problem.
What do the logs say?
-
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 - ScriptCore v2.6 loaded! Found 17 scripts...
10-02-06 20:20:02 - Compiling Admin Invincibility -> Invin.pas...
10-02-06 20:20:02 - Compiling autobot -> ab.pas...
10-02-06 20:20:02 - autobot -> [Error] (2:1): 'BEGIN' expected
10-02-06 20:20:02 - Compiling blank -> LogInSystem.pas...
10-02-06 20:20:02 - Compiling commands -> commands.pas...
10-02-06 20:20:02 - Compiling CriticalHit -> ch.pas...
10-02-06 20:20:02 - Compiling default -> Core.pas...
10-02-06 20:20:02 - Compiling default -> NetworkCore.pas...
10-02-06 20:20:02 - Compiling default -> AdminCore.pas...
10-02-06 20:20:02 - Compiling Invisibility -> Invis.pas...
10-02-06 20:20:02 - Compiling log -> log.pas...
10-02-06 20:20:02 - Compiling Medic -> Medic.pas...
10-02-06 20:20:02 - Compiling MoveTeam -> MoveTeam.pas...
10-02-06 20:20:02 - Compiling Nextmap -> core.pas...
10-02-06 20:20:02 - Compiling slicerzombie -> sz.pas...
10-02-06 20:20:02 - Compiling SpecialBots -> SpecialBots.pas...
10-02-06 20:20:02 - Compiling sprees -> spree.pas...
10-02-06 20:20:02 - Compiling subadmin -> sub.pas...
10-02-06 20:20:02 - Compiling Taliban -> Taliban.pas...
10-02-06 20:20:02 - Compiling Weapon_shop -> Weapon_shop.pas...
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
-
Your autobot script is doing the problem.
-
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.
-
The problem is obviously like in his zombie adding script, as he cant write the syntax properly.
-
whaaaaaaat
the includes is the problem?
-
Compiling autobot -> ab.pas...
10-02-06 20:20:02
autobot -> [Error]
THIS SCRIPT IS THE PROBLEM
-
i know but how i make this script working
-
Learn how to write scripts properly?
-
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 ???????
-
procedure OnJoinTeam(ID, Team: byte);
-
OK if that is wrong :
procedure OnJoinTeam(ID, Team: byte);
what i need to put
??? ??? ??? ???
-
you were missing a space
-
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 ???
-
I made it extra noticeable:
(http://i46.tinypic.com/2myw7jt.jpg)
-
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.
-
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
-
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":
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..
-
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)
-
Let me kill this thread once and for all...
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;