Author Topic: Helping with my first script  (Read 4018 times)

0 Members and 1 Guest are viewing this topic.

Offline Irlandec

  • Soldier
  • **
  • Posts: 176
Re: Helping with my first script
« Reply #20 on: July 23, 2008, 07:19:53 am »
New source code goes somewhere in this page, no offend . All problems was fixed by shantec by the way
« Last Edit: July 25, 2008, 01:49:25 am by Irlandec »

Offline shantec

  • Soldier
  • **
  • Posts: 140
  • Get ANGREH!!
Re: Helping with my first script
« Reply #21 on: July 23, 2008, 10:28:23 am »
[retard]



...


Press it i fecking dare you!
Also Known As REIMA


Lol Happles (happy apples)

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: Helping with my first script
« Reply #22 on: July 23, 2008, 01:34:22 pm »
lol @ var names... i swear i saw them before <.<

Offline Irlandec

  • Soldier
  • **
  • Posts: 176
Re: Helping with my first script
« Reply #23 on: July 24, 2008, 01:55:13 pm »
Ya ,danmer , i got them from your ZS script. If you don't like 'em , I will change

shantec , respect, thx for editing. (I think you saw the credits lines :)


Offline As de Espada

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1493
  • Mapper
    • My maps
Re: Helping with my first script
« Reply #24 on: July 24, 2008, 02:22:21 pm »
when it'll be released?
All my maps | my latest map: SoldatX Racing Mappack
me making a map on youtube: ctf_FastMade

Offline Irlandec

  • Soldier
  • **
  • Posts: 176
Re: Helping with my first script
« Reply #25 on: July 25, 2008, 04:03:26 am »
When it will be done... I still want to implant some commands in , like !kit, and add most needed part in script.
I'm still a beginner in scripting , but i will put those people names in credits , who helped me most or a bit.   [pigtail]
Don't worry , you will be informed first :)






Date Posted: July 24, 2008, 03:43:55 pm
Is it possible to make timers for commands( like timer1 for /blah command , timer2 for /test etc)?

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: Helping with my first script
« Reply #26 on: July 25, 2008, 04:52:38 am »
I'm not sure what you mean, but you can delay commands.
And you can use commands to make timers.
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline Irlandec

  • Soldier
  • **
  • Posts: 176
Re: Helping with my first script
« Reply #27 on: August 01, 2008, 09:25:04 am »
Actually , i want different timers for different commands

Date Posted: July 25, 2008, 01:20:24 pm
Meanwhile,
Code: [Select]
const
 DPM = 3;

var
 dp: array[1..32] of integer;
 
procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
begin
 if (GetPlayerStat(Victim,'Team') = 1 then begin
  dp[ID] := 1
 end;
end;

procedure OnPlayerRespawn(ID: Byte);
begin
 if GetPlayerStat(ID, 'Team') = 1 then begin
  SetWeaponActive(ID,13,false);
 end;
 if dp[ID] := DPM then
  if (GetPlayerStat(ID,'Team')) <> 5 then begin
      Command('/setteam5 ' +inttostr(ID));
 end;
end;

I wanted that: if player gets killed , he gets 1 dp. If player's dp count reaches DPM , he gets function mentioned in second procedure. Can you be so kind , and check the code?

Date Posted: July 25, 2008, 02:03:42 pm
Plzz help me :)

Date Posted: July 26, 2008, 03:12:13 pm
Added new command !rage ( player gets a bersek kit, long cooldown)

Date Posted: July 28, 2008, 07:37:08 am
Command failed , i dunno how to make second timer for this command

Date Posted: July 28, 2008, 12:01:56 pm
Well , i tried to make a dethpoint code ,and im near from finishing it Here it goes:

Code: [Select]
const
DeathPointMax = 3;
Num_Of_Pl=10;

var
dp: array[1..Num_Of_Pl] of integer;
PlayerLock: array[1..32] of byte;

//Lock procedure by DorkeyDear(Curt)
procedure Lock(Id, Team: byte);
begin
  PlayerLock[Id] := Team;
  if (Team < 6) then begin
    SayToPlayer(Id, 'You are locked on team ' + InttoStr(Team) + '.');
    if (GetPlayerStat(Id, 'Team') <> Team) then Command('/setteam' + InttoStr(Team) + ' ' + InttoStr(Id));
  end;
end;


procedure DeathPointCount(ID: byte);
begin
  dp[ID]:=dp[ID]+1;
    if dp[ID]=DeathPointMax then begin
     WriteConsole(ID,'Sorry, out of respawns!',$EE00FFFF);
     Lock(ID, 5)
  end else
     WriteConsole(ID,'Now you have '+inttostr(dp[ID])+'/'+inttostr(DeathPointMax)+' deathpoints',$EE00FFFF);
end;

procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
begin
 if (GetPlayerStat(Victim,'Team') = 1 then begin
  DeathPointCount(Victim)
 end;
end;

procedure OnPlayerRespawn(ID: Byte);
begin
 if dp[ID] := DeathPointMax then
  if (GetPlayerStat(ID,'Team')) <> 5 then begin
      Command('/setteam5 ' +inttostr(ID));
 end;
end;

Can u be so kind and check it please?
errored in line 32

Date Posted: July 31, 2008, 03:23:14 pm
Guys please help on these two problems(they stopped me from improving script)

P.S. : Second problem with timers for commands btw

Offline Norbo

  • Camper
  • ***
  • Posts: 338
Re: Helping with my first script
« Reply #28 on: August 01, 2008, 09:27:24 am »
I will help you, no problem, but send me the whole script and tell me whazzap with it

Offline Irlandec

  • Soldier
  • **
  • Posts: 176
Re: Helping with my first script
« Reply #29 on: August 01, 2008, 11:44:36 am »
See my #27 post for the first problem. Second problem can be explained by skilled scripters of this forum.

By the way, when these problems will be solved , i will put mah script for public(of cause , for beta testing , not releasing yet ;) )

Offline dark_danny13

  • Major(1)
  • Posts: 2
Re: Helping with my first script
« Reply #30 on: August 01, 2008, 05:11:28 pm »
mmmm my compiler said

1 / 1 maniac~1.pas
 Fatal: Syntax error, BEGIN expected but identifier ONST found

with your code.....

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1906
Re: Helping with my first script
« Reply #31 on: August 01, 2008, 05:20:50 pm »
mmmm my compiler said

1 / 1 maniac~1.pas
 Fatal: Syntax error, BEGIN expected but identifier ONST found

with your code.....

... Hang on. Are you actually attempting to compile the scripts using a pascal compiler? The scripts are meant to be compiled (interpreted?) by the Soldat server.

Offline Irlandec

  • Soldier
  • **
  • Posts: 176
Re: Helping with my first script
« Reply #32 on: August 02, 2008, 04:17:24 am »
Pascal compiler cannot compile soldatscripts, I dunno why. Compile with Soldat Dedicated.


Offline saad786

  • Major(1)
  • Posts: 35
Re: Helping with my first script
« Reply #34 on: August 04, 2008, 08:31:31 pm »
OMG Scripting is HARD  :'(

Offline shantec

  • Soldier
  • **
  • Posts: 140
  • Get ANGREH!!
Re: Helping with my first script
« Reply #35 on: August 05, 2008, 06:43:31 am »
Scripting is easy, you'r just too NEWBIE (no, its not noob)

Look someone elses scripts, it'll help a lot. Thats how i learned to script :p
Also Known As REIMA


Lol Happles (happy apples)

Offline Irlandec

  • Soldier
  • **
  • Posts: 176
Re: Helping with my first script
« Reply #36 on: August 15, 2008, 04:39:07 am »
:( freezed on this problem , help needed
Quote
Well , i tried to make a dethpoint code ,and im near from finishing it Here it goes:


Code:
const
DeathPointMax = 3;
Num_Of_Pl=10;

var
dp: array[1..Num_Of_Pl] of integer;
PlayerLock: array[1..32] of byte;

//Lock procedure by DorkeyDear(Curt)
procedure Lock(Id, Team: byte);
begin
  PlayerLock[Id] := Team;
  if (Team < 6) then begin
    SayToPlayer(Id, 'You are locked on team ' + InttoStr(Team) + '.');
    if (GetPlayerStat(Id, 'Team') <> Team) then Command('/setteam' + InttoStr(Team) + ' ' + InttoStr(Id));
  end;
end;


procedure DeathPointCount(ID: byte);
begin
  dp[ID]:=dp[ID]+1;
    if dp[ID]=DeathPointMax then begin
     WriteConsole(ID,'Sorry, out of respawns!',$EE00FFFF);
     Lock(ID, 5)
  end else
     WriteConsole(ID,'Now you have '+inttostr(dp[ID])+'/'+inttostr(DeathPointMax)+' deathpoints',$EE00FFFF);
end;

procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
begin
if (GetPlayerStat(Victim,'Team') = 1 then begin
  DeathPointCount(Victim)
end;
end;

procedure OnPlayerRespawn(ID: Byte);
begin
if dp[ID] := DeathPointMax then
  if (GetPlayerStat(ID,'Team')) <> 5 then begin
      Command('/setteam5 ' +inttostr(ID));
end;
end;


Can u be so kind and check it please?
 --------------------------------------------------



Offline shantec

  • Soldier
  • **
  • Posts: 140
  • Get ANGREH!!
Re: Helping with my first script
« Reply #37 on: August 15, 2008, 07:45:08 am »
procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
begin
if (GetPlayerStat(Victim,'Team') = 1 then begin
  DeathPointCount(Victim);
end;
end;
Also Known As REIMA


Lol Happles (happy apples)