Author Topic: Script [help]  (Read 5103 times)

0 Members and 1 Guest are viewing this topic.

Offline Hubiq

  • Soldier
  • **
  • Posts: 119
Script [help]
« 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;

Offline machina

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1117
  • The world isn't nice. Why should I be...?
Re: Script [help]
« Reply #1 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;
« Last Edit: May 06, 2017, 10:01:08 am by machina »

Offline Hubiq

  • Soldier
  • **
  • Posts: 119
Re: Script [help]
« Reply #2 on: May 06, 2017, 10:36:12 am »
thanks  :D

Offline machina

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1117
  • The world isn't nice. Why should I be...?
Re: Script [help]
« Reply #3 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.

Offline Ratman

  • Major(1)
  • Posts: 34
Re: Script [help]
« Reply #4 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.

Offline NiCeShOoT|GuY

  • Major(1)
  • Posts: 21
Re: Script [help]
« Reply #5 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.