Official Soldat Forums

Server Talk => Scripting Discussions and Help => Topic started by: Hubiq on May 06, 2017, 09:45:23 am

Title: Script [help]
Post by: Hubiq on May 06, 2017, 09:45:23 am
My script doesn't work  :-\ Where is the mistake?

Code: [Select]
procedure OnPlayerSpeak(ID: Byte; Text: string);
begin
   
  if (Text='!cmds1') then begin
   WriteConsole(ID, '!teams, !balance', $33ccff);
  end;
  if (Text='!cmds2') then begin
   WriteConsole(ID, '!alpha, !bravo, !spec', $33ff66);
end;
Title: Re: Script [help]
Post by: machina on May 06, 2017, 09:58:45 am
Missing end; after second if statement? I'm not programming in Pascal but it would make sense to me as I code a little bit in M Script.

Code: [Select]
procedure OnPlayerSpeak(ID: Byte; Text: string);
begin
  if (Text='!cmds1') then begin
   WriteConsole(ID, '!teams, !balance', $33ccff);
  end;
  if (Text='!cmds2') then begin
   WriteConsole(ID, '!alpha, !bravo, !spec', $33ff66);
  end;    // <--------------------- could this be missing?
end;
Title: Re: Script [help]
Post by: Hubiq on May 06, 2017, 10:36:12 am
thanks  :D
Title: Re: Script [help]
Post by: machina on May 06, 2017, 12:12:28 pm
thanks  :D
You should probably get better IDE that would highlight such errors for your work as it is rather a simple mistake.
Title: Re: Script [help]
Post by: Ratman on May 14, 2017, 05:30:32 pm
thanks  :D

Get Lazarus IDE, its what Im using now and can help you find mistakes like that easily.
Title: Re: Script [help]
Post by: NiCeShOoT|GuY on June 26, 2017, 11:51:15 pm
notepad is for experts. I agree 110%  ;D

Get Lazarus IDE, its what Im using now and can help you find mistakes like that easily.