Author Topic: wierd or stupid problem  (Read 649 times)

0 Members and 1 Guest are viewing this topic.

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
wierd or stupid problem
« on: January 20, 2008, 10:12:02 pm »
I was reading some more pascal tuts when I noticed one of the examples had a line that said
delay(10)
So I tried to make a script to test it:
Code: [Select]
OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if text = '/delaytest' then begin
result:=false
WriteConsole(ID,'.',$FFFFFFFF)
delay(10)
WriteConsole(ID,'.',$FFFFFFFF)
delay(20)
WriteConsole(ID,'.',$FFFFFFFF)
delay(50)
WriteConsole(ID,'.',$FFFFFFFF)
delay(100)
WriteConsole(ID,'.',$FFFFFFFF)
delay(250)
WriteConsole(ID,'.',$FFFFFFFF);
end;
end;

And true to my scripting abilities, it didn't work.

The problem is the 'BEGIN' expected  one, but the strange thing is I get the same message with this:
Code: [Select]
OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
end;

And this:
Code: [Select]
OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
         result:=false
        end;
even many different positions of semicolons
Wierd?, No?, well I think it is.

Solutions, please.
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: wierd or stupid problem
« Reply #1 on: January 21, 2008, 02:38:39 am »
1) you're missing "function" in front of OnPlayerCommand(
2) you're missing a semicolon after delay(10) , but it doesn't make any difference, since
3) there is no such thing as delay() in the scriptcore afaik
4) there's sleep() , but it pauses the whole script, so it's not recommended to use it

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: wierd or stupid problem
« Reply #2 on: January 21, 2008, 03:29:51 pm »
>_<

oh, ok thanks.

I was actually seeing if there was such thing as delay, so if an error message came up like 'delay not recognized', I would know, because I thought delay could be an alternative to sleep, as it might not pause the whole script. Which would be good.
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs