Author Topic: Problem with scripts  (Read 2084 times)

0 Members and 1 Guest are viewing this topic.

Offline MFA

  • Major(1)
  • Posts: 15
Problem with scripts
« on: March 16, 2010, 03:42:33 pm »
Hi. I have a two don't working script. Help me please, what is wrong?

First:
Code: [Select]
const
  Color = $FFD700;

procedure OnJoinTeam(ID, Team: byte);

var
  i: integer;

begin

if (Team <> 1) and (Team <> 5) then begin
Command('/setteam1 ' + IntToStr(ID));
WriteConsole(ID, 'Do Alpha i to juz!',Color);
end;
end;
end;

Second:
Code: [Select]
procedure AppOnIdle(Ticks: integer);
begin

if Ticks mod (60) = 0 then begin

SpawnObject(GetPlayerStat(1,'x'),GetPlayerStat(1,'y'),17);
SpawnObject(GetPlayerStat(2,'x'),GetPlayerStat(2,'y'),17);
SpawnObject(GetPlayerStat(3,'x'),GetPlayerStat(3,'y'),17);
SpawnObject(GetPlayerStat(4,'x'),GetPlayerStat(4,'y'),17);
SpawnObject(GetPlayerStat(5,'x'),GetPlayerStat(5,'y'),17);
SpawnObject(GetPlayerStat(6,'x'),GetPlayerStat(6,'y'),17);
SpawnObject(GetPlayerStat(7,'x'),GetPlayerStat(7,'y'),17);
SpawnObject(GetPlayerStat(8,'x'),GetPlayerStat(8,'y'),17);

end;

end;

procedure OnPlayerRespawn(ID: Byte);
begin

ForceWeapon(ID, 11, 11, 1);

end;

procedure OnFlagScore(ID, TeamFlag: byte);
begin
SetPlayerStat( ID , 'health' , 0 );
end;
« Last Edit: March 18, 2010, 10:52:11 am by MFA »

Offline JFK

  • Camper
  • ***
  • Posts: 255
    • My TraxInSpace Account
Re: Problem with scripts
« Reply #1 on: March 16, 2010, 03:58:58 pm »
Hi,

Please explain what the script is supposed to do and what exactly goes wrong.
Come join: EliteCTF
Listen to: My Music

Offline MFA

  • Major(1)
  • Posts: 15
Re: Problem with scripts
« Reply #2 on: March 17, 2010, 03:19:40 am »
First script is "Anty bravo", and second is mix of infinite nades, give two flamers at respawn, and kill flag scorer. When i give one of this scripts to server, i can't connect to it. All of the time Soldat written text "Trying to connect".

Offline croat1gamer

  • Veteran
  • *****
  • Posts: 1327
  • OMG CHANGING AVATAR!!! ^ω^
Re: Problem with scripts
« Reply #3 on: March 17, 2010, 03:35:41 am »
Home hosted?
You must use the ip 127.0.0.1
Last year, I dreamt I was pissing at a restroom, but I missed the urinal and my penis exploded.

Offline MFA

  • Major(1)
  • Posts: 15
Re: Problem with scripts
« Reply #4 on: March 17, 2010, 04:30:46 am »
No, hosted by whiterabbit.pl

Offline Silnikos

  • Soldier
  • **
  • Posts: 129
Re: Problem with scripts
« Reply #5 on: March 18, 2010, 04:53:13 pm »
Too many ends in first one.

Second one uses SetPlayerStat, this function works only on BETA soldat's server version.
« Last Edit: March 18, 2010, 04:55:44 pm by Silnikos »

Offline KEEN

  • Major
  • *
  • Posts: 95
  • soldat champagne
    • Soldat Argentina
Re: Problem with scripts
« Reply #6 on: March 19, 2010, 08:28:15 am »
Code: [Select]
const
 Color = $FFD700;

procedure OnJoinTeam(ID, Team: byte);
 begin
  if (Team <> 1) and (Team <> 5) then
   begin
    Command('/setteam1 ' + IntToStr(ID));
    WriteConsole(ID, 'Do Alpha i to juz!',Color);
   end;
 end;

u declare "i: integer;" but u never use, unless it is used in 'Do Alpha i to juz!'

Offline MFA

  • Major(1)
  • Posts: 15
Re: Problem with scripts
« Reply #7 on: March 20, 2010, 05:04:59 am »
Thanks ;D

First script is working:
Code: [Select]
procedure OnJoinTeam(ID, Team: byte);
begin

if (Team <> 1) and (Team <> 5) then begin

           Command('/setteam1 '+IntToStr(ID));

        end;

end;

But, second script still don't working:

Code: [Select]
procedure AppOnIdle(Ticks: integer);
Begin

if Ticks mod (60) = 0 then

Begin

SpawnObject(GetPlayerStat(1,'x'),GetPlayerStat(1,'y'),17);
SpawnObject(GetPlayerStat(2,'x'),GetPlayerStat(2,'y'),17);
SpawnObject(GetPlayerStat(3,'x'),GetPlayerStat(3,'y'),17);
SpawnObject(GetPlayerStat(4,'x'),GetPlayerStat(4,'y'),17);
SpawnObject(GetPlayerStat(5,'x'),GetPlayerStat(5,'y'),17);
SpawnObject(GetPlayerStat(6,'x'),GetPlayerStat(6,'y'),17);
SpawnObject(GetPlayerStat(7,'x'),GetPlayerStat(7,'y'),17);
SpawnObject(GetPlayerStat(8,'x'),GetPlayerStat(8,'y'),17);

end;

end;

procedure OnPlayerRespawn(ID: Byte);
begin

ForceWeapon(ID, 11, 11, 0);

end;

procedure OnFlagScore(ID, TeamFlag: byte);
begin
Command('/kill '+inttostr(ID));
end;



Quote
u declare "i: integer;" but u never use, unless it is used in 'Do Alpha i to juz!'
I delete this line :]

Offline croat1gamer

  • Veteran
  • *****
  • Posts: 1327
  • OMG CHANGING AVATAR!!! ^ω^
Re: Problem with scripts
« Reply #8 on: March 20, 2010, 05:19:32 am »
Code: [Select]
procedure AppOnIdle(Ticks: integer);
Begin

if Ticks mod (60) = 0 then for i:= 1 to 32 do begin
SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),17);
if GetPlayerStat(i,'primary') <> 11 then ForceWeapon(i, 11, 11, 0);
end;

end; // this will give them permanent flamers


procedure OnFlagScore(ID, TeamFlag: byte);
begin
Command('/kill '+inttostr(ID));


end;

What is the gametype you are going to host?
Last year, I dreamt I was pissing at a restroom, but I missed the urinal and my penis exploded.

Offline KEEN

  • Major
  • *
  • Posts: 95
  • soldat champagne
    • Soldat Argentina
Re: Problem with scripts
« Reply #9 on: March 20, 2010, 08:03:03 am »
What's the error you see when starting compilation?

Offline MFA

  • Major(1)
  • Posts: 15
Re: Problem with scripts
« Reply #10 on: March 20, 2010, 11:17:08 am »
Croat1gamer, thanks. You forget about include varrible i  ;). But it still dont working :( Game mode is ctf.

Quote
What's the error you see when starting compilation?
Just none, but server don't working...

Offline croat1gamer

  • Veteran
  • *****
  • Posts: 1327
  • OMG CHANGING AVATAR!!! ^ω^
Re: Problem with scripts
« Reply #11 on: March 20, 2010, 11:25:02 am »
Can you say what do the logs say?
I cant check what is wrong right now.
Last year, I dreamt I was pissing at a restroom, but I missed the urinal and my penis exploded.

Offline MFA

  • Major(1)
  • Posts: 15
Re: Problem with scripts
« Reply #12 on: March 20, 2010, 02:29:20 pm »
Code: [Select]
[*] ScriptCore v2.6 loaded! Found 2 scripts...
[*] Compiling default -> Core.pas...
[*] Compiling default -> NetworkCore.pas...
[*] Compiling default -> AdminCore.pas...
[*] Compiling InfNades -> InfNades.pas...
[*] Compilaton Coplete.

I testing it at home computer, no in server :|
But server have this same version Script Core

Offline y0uRd34th

  • Camper
  • ***
  • Posts: 325
  • [i]Look Signature![/i]
Re: Problem with scripts
« Reply #13 on: March 20, 2010, 03:40:22 pm »
No errors at all, does the server shutdown after you start it, or what is the problem?

Offline MFA

  • Major(1)
  • Posts: 15
Re: Problem with scripts
« Reply #14 on: March 22, 2010, 11:21:39 am »
I do this...
Server dont working with this script  :(

Offline MFA

  • Major(1)
  • Posts: 15
Re: Problem with scripts
« Reply #15 on: April 12, 2010, 11:33:37 am »
Ok, this is forceweapon bug, im updated server and script is working!
But i have another question - when im give flamer to someone, server kicked him for "Not allowed weapon". Can do something to repair it?

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Problem with scripts
« Reply #16 on: April 12, 2010, 11:39:05 am »
Set DisableAntiCheat=1 in soldat.ini.

Offline MFA

  • Major(1)
  • Posts: 15
Re: Problem with scripts
« Reply #17 on: April 13, 2010, 04:12:50 am »
Yeah, thanks.