Author Topic: cool script in the making, but problem  (Read 892 times)

0 Members and 1 Guest are viewing this topic.

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
cool script in the making, but problem
« on: January 24, 2008, 05:05:26 pm »
Heres a snippet of code that i have narrowed the problem down to:

Code: [Select]
Procedure AppOnIdle(Ticks: integer);

var
i: Integer;

begin
if Knife_Drop_Info.Started = True then begin
Knife_Drop_Info.Timer:= Knife_Drop_Info.Timer + 1;
end;
if (Knife_Drop_Info.Countdown = True) and (Knife_Drop_Info.CTimer <> -1) then begin
for i:= 1 to 32 do begin
if Player_Info[i].In_KD:= True then begin
DrawText(i,'Knife Drop will begin in ' +inttostr(Knife_Drop_Info.CTimer) ' Seconds', 60,$FF9AAABC, 0.3,10,230);
end;
end;
Knife_Drop_Info.CTimer:= Knife_Drop_Info.CTimer - 1;
end;
if Knife_Drop_Info.CTimer = -1 then begin
Knife_Drop_Info.Countdown:= False
Knife_Drop_Info.Started:= True;
end;
if Knife_Drop_Info.Started = True then begin
Knife_Drop_Drop();
end;

end;

  • *Not revealing name* -> [Error] (122:28): 'THEN' expected


I have not as of yet experienced this problem, so do not know what is wrong, I assumed at first that I had forgotten a 'then' in an if statement, but can not spot it, or thats not the  problem.

Enlighten me, oh wise ones

EDIT: oh, yeah, all the variables that are those type ones you do at the start are globally declared and all that.

EDIT AGAIN: whoops, my mind is broken today, Does the (122:28) refer to a line and column?, if so, the first line of code in that snippet, the apponidle, is line 110.

Yay 100 posts   ;D
« Last Edit: January 24, 2008, 05:09:41 pm by chutem »
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline Mr Pink

  • Major(1)
  • Posts: 37
Re: cool script in the making, but problem
« Reply #1 on: January 24, 2008, 06:02:49 pm »
couple of errors i can see:

if Player_Info.In_KD:= True then begin

remove ':'

if Knife_Drop_Info.CTimer = -1 then begin
         Knife_Drop_Info.Countdown:= False

needs ';' at the end of the declaration


Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: cool script in the making, but problem
« Reply #2 on: January 24, 2008, 07:07:26 pm »
The first error fixe that problem, but I don't think there is supposed to be a semicolon at the end of the
' Knife_Drop_Info.Countdown:= False' line, because, as Chrisbgk said, its only one logical line.

Now I get an error
  • *Not revealing name* -> [Error] (123:79): comma (',') expected


>_<
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: cool script in the making, but problem
« Reply #3 on: January 24, 2008, 07:20:19 pm »
Code: [Select]
DrawText(i,'Knife Drop will begin in ' +inttostr(Knife_Drop_Info.CTimer) ' Seconds', 60,$FF9AAABC, 0.3,10,230);Fixed:
Code: [Select]
DrawText(i,'Knife Drop will begin in ' +inttostr(Knife_Drop_Info.CTimer) + ' Seconds', 60,$FF9AAABC, 0.3,10,230);

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: cool script in the making, but problem
« Reply #4 on: January 25, 2008, 02:33:45 am »
...

I assumed that you only had to put he plus signs when doing inttostr or somthing along those lines,

Silly, silly me.
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: cool script in the making, but problem
« Reply #5 on: January 25, 2008, 09:43:55 am »
...

I assumed that you only had to put he plus signs when doing inttostr or somthing along those lines,

Silly, silly me.

You use it anytime you want to concantenate 2 strings.

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: cool script in the making, but problem
« Reply #6 on: January 25, 2008, 06:37:23 pm »
Concantenate, wow, what a cool word,

I guess that means something along the lines of join?
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline rhide

  • Major
  • *
  • Posts: 60
  • Coffee-addict
    • Vrastar-Hai soldat clan
Warning! Division by zero seriously injures yourself and the people in your surroundings.

Proud member of Vrastar-Hai:
http://www.guldheden.com/~erga050/vrastar-hai