Author Topic: Kill on off  (Read 3304 times)

0 Members and 1 Guest are viewing this topic.

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Kill on off
« on: September 07, 2007, 08:29:22 pm »
Dorkeydear, scroll down to one in code box that I made. this is the old version. it is way down in one of my posts.

Dear EnEsCe, or anyone else whos a good scripter,

I have a script (first that i made) and it is 80% the same as the Cap on off script. I will paste it below, but first, my scripts folder has Default and Killonoff. The Default Folder is the same, but the Killonoff one Has Includes.txt with the name of the file. The Default and killonoff folders are both activated, but it does not work. Can you take a look and see what the problem is? (im a n00b scripter) Thanks, here it is:

var
kill : boolean;
function OnCommand(ID: Byte; Text: string): boolean;
begin
if Text='/killon' then begin
DrawText(0,'LET THE BLOOD BATH BEGIN!!!',300,RGB(255,255,255),0.15,40,240);
Command('/say SLAUGHTER THE OTHER TEAM!!!');
kill :=true;
end else if Text='/killoff' then begin
DrawText(0,'KILLING WILL RESULT IN DEATH!!!',300,RGB(255,255,255),0.15,40,240);
Command('/say You better not kill, or me, the server, will kill you!!!');
kill :=false;
end;
end;
procedure OnJoinGame(ID, Team: byte);
begin
if kill=false then begin
DrawText(ID,'NO KILLING, OR YOU DIE!!! ',300,RGB(255,255,255),0.15,40,240);
end else if kill=true then begin
DrawText(ID,'Kill All You like!!!',300,RGB(255,255,255),0.15,40,240);
end;
end;
procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);: boolean);
begin
if kill=false then begin
Command('/kill ' + inttostr(ID));
Command('/say KILLING IS BAD!');
Command('/say THAT MEANS YOU, ' + IDToName(ID) + '!');
End;
End;
procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
begin
if kill=false then begin
Command('/kill ' + inttostr(ID));
Command('/say HOW DARE YOU KILL!!!');
end;
end;
procedure OnJoinGame(ID, Team: byte);
begin
if kill=false then begin
DrawText(ID,'Killing is Forbiden!',300,RGB(255,255,255),0.15,40,240);
end else if kill=true then begin
DrawText(ID,'Let the game begin!!!',300,RGB(255,255,255),0.15,40,240);
end;
end;

That's it.
Whats Wrong? :o :( >:( ??? :P :-[ :-X :-\ :'(
If you know, respond ASAP if you can...

Thanks,
1221995
« Last Edit: September 08, 2007, 04:51:19 pm by 1221995 »

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1906
Re: Kill on off
« Reply #1 on: September 08, 2007, 12:20:34 am »
You had a few duplicate procedures in there.

Code: [Select]
var
kill : boolean;

function OnCommand(ID: Byte; Text: string): boolean;
begin
result:=false;
if Text='/killon' then begin
DrawText(0,'LET THE BLOOD BATH BEGIN!!!',300,RGB(255,255,255),0.15,40,240);
Command('/say SLAUGHTER THE OTHER TEAM!!!');
kill:=true;
end else if Text='/killoff' then begin
DrawText(0,'KILLING WILL RESULT IN DEATH!!!',300,RGB(255,255,255),0.15,40,240);
Command('/say You better not kill, or me, the server, will kill you!!!');
kill:=false;
end;
end;

procedure OnJoinGame(ID, Team: byte);
begin
if kill=false then
DrawText(ID,'NO KILLING, OR YOU DIE!!! ',300,RGB(255,255,255),0.15,40,240)
else if kill=true then
DrawText(ID,'Kill All You like!!!',300,RGB(255,255,255),0.15,40,240);
end;

procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
if kill=false then begin
Command('/kill ' + inttostr(Killer));
Command('/say KILLING IS BAD!');
Command('/say THAT MEANS YOU, ' + GetPlayerStat(Killer,'name') + '!');
end;
end;

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: Kill on off
« Reply #2 on: September 08, 2007, 10:33:11 am »
Uh, I tried that, but is my folder set up wrong? it still doesnt work... :(
My folder goes:
                                   <Default
SoldatServer>Scripts>
                                   <Killonoff
In killonoff I have Killscript.pas,and includes.txt
In Default I have Socket, admin, core, network,whatever else and includes.txt.
It Still doesnt work, so whats the problem? PLease respond

Thanks
1221995                                     
« Last Edit: September 08, 2007, 12:04:59 pm by 1221995 »

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1906
Re: Kill on off
« Reply #3 on: September 08, 2007, 12:19:08 pm »
What error does the dedicated server spit at you when you try to run it?

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: Kill on off
« Reply #4 on: September 08, 2007, 12:43:35 pm »
It doesnt run, but just emediately closes. ill try to take a screen shot and tell you... one minute...
ok, it compiles it and then just closes... it says compilin killonoff.pas and i couldnt get anything past that cause its too fast to take a good shot... >:( ??? :-\ :'(
« Last Edit: September 08, 2007, 12:48:58 pm by 1221995 »

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1906
Re: Kill on off
« Reply #5 on: September 08, 2007, 01:05:55 pm »
Run it from a command window -- Start, Run, cmd, make your way to the soldat server directory, and run it.
If you aren't all too good with command lines then download this, put run.bat inside your server directory, and double click that.

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: Kill on off
« Reply #6 on: September 08, 2007, 01:59:28 pm »
thanks! I found the error. It says 'begin expected'. ill look at the script and find were to put it. be right back.

ok i fixed first problem now it says identifier expected...? What does that mean?

[Edit] I restarted (remade) the script, and so far so good!!! its not done yet though... Get back to you soon toumaz

Date Posted: September 08, 2007, 02:20:30 PM
whats an invalid number of paremeters?

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1906
Re: Kill on off
« Reply #7 on: September 08, 2007, 02:09:00 pm »
whats an invalid number of paremeters?

When you're not using the proper number of parameters when calling a procedure or function. For example, doing something like GetPlayerXY(ID,X) would give that error.

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: Kill on off
« Reply #8 on: September 08, 2007, 02:56:01 pm »
ok, one more error showed up. I fixed that one and now it says "<8:8> Assignment expected".
Now What???:(

Date Posted: September 08, 2007, 03:29:00 PM
hi dorkeydear, your reading the topic

Date Posted: September 08, 2007, 03:34:36 PM
Hi Tosty. If anyone is reading PLEASE RESPOND!!! O_.
« Last Edit: September 08, 2007, 02:58:29 pm by 1221995 »

Offline Tosty

  • Soldier
  • **
  • Posts: 172
  • Ultimate TW Medic
    • Just Click it
Re: Kill on off
« Reply #9 on: September 08, 2007, 02:59:03 pm »
Hi, im also a niib scripter so i cant help

P.s. it would help touma if you put the script here so he could tell you whats wrong

Code: [Select]
Make shure to put it in a code box



Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: Kill on off
« Reply #10 on: September 08, 2007, 04:32:45 pm »
Ok Toumaz, Or anyone else. Here it is so far...

Code: [Select]
var
kill:boolean;
function OnCommand(ID: Byte; Text: string): boolean;
begin
If text='/killon' then begin
command('/say KILL AWAY!!!');
Result kill :=true
end;
if Text='/killoff' then begin
command('/say NO KILLING!!!');
Result kill:=false
end;
end;
procedure OnJoinGame(ID, Team: byte);
begin
if kill=false then begin
command(ID, '/say This Server Uses 1221995s aka Chuck Ps kill on off script. DO NOT KILL OR YOU WILL DIE!!!');
end;
if kill=true then begin
command(ID, '/say This Server Uses 1221995s aka Chuck Ps kill on off script. Killing is allowed for now');
end;
end;
procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
begin
if kill=false then begin
command(killer, '/say HOW DARE YOU KILL!!! DIE, DIE, DIE!!!');
command(killer, '/kill');
command(killer, '/kill');
command(killer, '/kill');
End;
End;

I used Kill 3 times to illustrate the DIE DIE DIE thing... :P

1221995 ;D

Offline Commander Kitsune

  • Soldier
  • **
  • Posts: 249
  • Kits
Re: Kill on off
« Reply #11 on: September 08, 2007, 04:37:16 pm »
Hmm, I'm no coder, but this is common logic speaking. Wouldnt you need to put a pause in between the three /kills?

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: Kill on off
« Reply #12 on: September 08, 2007, 04:42:25 pm »
no, i dont think that makes a difference...

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1906
Re: Kill on off
« Reply #13 on: September 08, 2007, 04:52:28 pm »
Code: [Select]
var
kill:boolean;

function OnCommand(ID: Byte; Text: string): boolean;
begin
if Text='/killon' then begin
Command('/say KILL AWAY!!!');
kill:=true;
end else if Text='/killoff' then begin
Command('/say NO KILLING!!!');
kill:=false
end;
end;

procedure OnJoinGame(ID, Team: byte);
begin
if kill=false then
SayToPlayer(ID,'This Server Uses 1221995s aka Chuck Ps kill on off script. DO NOT KILL OR YOU WILL DIE!!!')
else
SayToPlayer(ID,'This Server Uses 1221995s aka Chuck Ps kill on off script. Killing is allowed for now');
end;

procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
begin
if kill=false then begin
SayToPlayer(Killer,'/say HOW DARE YOU KILL!!! DIE, DIE, DIE!!!');
//Yes, I've removed the 3 kills in a row, because they -wouldn't make any sense to have-.
Command('/kill '+inttostr(Killer));
end;
end;
« Last Edit: September 08, 2007, 04:54:24 pm by Toumaz »

Offline Tosty

  • Soldier
  • **
  • Posts: 172
  • Ultimate TW Medic
    • Just Click it
Re: Kill on off
« Reply #14 on: September 08, 2007, 04:57:15 pm »
._.

OMFG

i tryed it and it just kept killing the bots rapidly right when the server started it

Then it said stack overflow and it shut down



Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: Kill on off
« Reply #15 on: September 08, 2007, 05:13:47 pm »
thanks.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Kill on off
« Reply #16 on: September 08, 2007, 06:07:49 pm »
Wait, so what are you wanting exactly? Something that makes it so you can't kill anybody? Or something that just yells at the killer if he kills somebody?

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: Kill on off
« Reply #17 on: September 08, 2007, 06:23:22 pm »
yo dorkeydear i already got the job done :)
It was something so u could choose weather u want killing or not.

Offline iDante

  • Veteran
  • *****
  • Posts: 1967
Re: Kill on off
« Reply #18 on: September 09, 2007, 12:46:54 am »
Why not just modify the invincibility script to be true for everyone?

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: Kill on off
« Reply #19 on: September 09, 2007, 07:13:02 am »
Does anyone know why this messes up the server???