Official Soldat Forums
Server Talk => Scripting Discussions and Help => Topic started by: |_ancer 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.
-
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;
-
Huh.. what u wrote definitively will help me to do another script :P
-
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.
-
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.
-
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.
-
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.