Author Topic: Getting confused  (Read 792 times)

0 Members and 1 Guest are viewing this topic.

Offline |_ancer

  • Soldier
  • **
  • Posts: 153
  • again and again.
Getting confused
« on: April 16, 2009, 09:02:12 am »
How do you make it when you type a commands like !commands or /help to show a list. I tried to make one but it never seems to show up.

Offline GSx_Major

  • Major
  • *
  • Posts: 97
Re: Getting confused
« Reply #1 on: April 16, 2009, 09:24:12 am »
Code: [Select]
procedure OnPlayerSpeak(ID: Byte; Text: String);
begin

  // Help
  if Text = '!commands' then begin
    WriteConsole(ID, 'Commands:', RGB(255, 255, 255));
    WriteConsole(ID, '!alpha', RGB(255, 255, 255));
    WriteConsole(ID, '!bravo', RGB(255, 255, 255));
  end;

  // Commands
  if Text = '!alpha' then Command('/setteam1 ' + IntToStr(ID));
  if Text = '!bravo' then Command('/setteam2 ' + IntToStr(ID));
end;
...and headbutt the sucker through your banana suit!

Offline ~Niko~

  • Rainbow Warrior
  • *****
  • Posts: 2410
Re: Getting confused
« Reply #2 on: April 16, 2009, 12:30:17 pm »
Huh.. what u wrote definitively will help me to do another script :P

Offline CurryWurst

  • Camper
  • ***
  • Posts: 265
    • Soldat Global Account System
Re: Getting confused
« Reply #3 on: April 16, 2009, 12:54:17 pm »
Done. Modify or add commands & rules by altering the specific text file.
The commands and rules list will be aligned by the script, so no scripting knowledge is required :)
By the way, I implemented my default LogInSystem commands list, I hope you don't mind.
Soldat Global Account System: #soldat.sgas @ quakenet

Offline |_ancer

  • Soldier
  • **
  • Posts: 153
  • again and again.
Re: Getting confused
« Reply #4 on: April 16, 2009, 08:11:24 pm »
Hmm that helped me but I'm wanting for /commands then it shows up. Not !commands because I want to keep it a secret thing.

Offline y0uRd34th

  • Camper
  • ***
  • Posts: 325
  • [i]Look Signature![/i]
Re: Getting confused
« Reply #5 on: April 17, 2009, 04:43:02 am »
Code: [Select]
function OnPlayerCommand(ID: Byte; Text: String): Boolean;
begin
  Result := False;
  // Help
  if Text = '/commands' then begin
    WriteConsole(ID, 'Commands:', RGB(255, 255, 255));
    WriteConsole(ID, '/alpha', RGB(255, 255, 255));
    WriteConsole(ID, '/bravo', RGB(255, 255, 255));
  end;

  // Commands
  if Text = '/alpha' then Command('/setteam1 ' + IntToStr(ID));
  if Text = '/bravo' then Command('/setteam2 ' + IntToStr(ID));
end;
NOT TESTET

Should Work.

Offline CurryWurst

  • Camper
  • ***
  • Posts: 265
    • Soldat Global Account System
Re: Getting confused
« Reply #6 on: April 17, 2009, 06:25:57 am »
Hmm that helped me but I'm wanting for /commands then it shows up. Not !commands because I want to keep it a secret thing.

My script actually does that.
Soldat Global Account System: #soldat.sgas @ quakenet