Author Topic: Help script for ! commands  (Read 1682 times)

0 Members and 1 Guest are viewing this topic.

Offline Zyyn

  • Major(1)
  • Posts: 21
Help script for ! commands
« on: May 16, 2007, 03:09:31 pm »
I need to know how to make a script for ! commands when people say them. Like if someone says !rate it will show rate, without using something like Arsse.

Offline Flippeh

  • Major
  • *
  • Posts: 58
  • Fish go moo :>
    • My Homepage
Re: Help script for ! commands
« Reply #1 on: May 16, 2007, 03:56:59 pm »
procedure OnPlayerSpeak(ID: byte; Text: string);
begin
   Case Text Of   
   '!lol' : Command('/say lols');
   End;
end;

Should work.

Offline Zyyn

  • Major(1)
  • Posts: 21
Re: Help script for ! commands
« Reply #2 on: May 16, 2007, 04:00:18 pm »
Ok thanks, but what about the variables?(kills,deaths,time, ect.....)

Offline Flippeh

  • Major
  • *
  • Posts: 58
  • Fish go moo :>
    • My Homepage
Re: Help script for ! commands
« Reply #3 on: May 16, 2007, 04:08:03 pm »
[...] Command('/say Your K/D is '+IntToStr(GetPlayerStat(ID, 'Kills') / GetPlayerStat(ID, 'Deaths'))+'.'); [...]

Untested and most likely not working, but i think it should help you get the point.

Offline Zyyn

  • Major(1)
  • Posts: 21
Re: Help script for ! commands
« Reply #4 on: May 16, 2007, 06:19:10 pm »
Umm that script didn't work for me. I turned off Arsse and tried the !rate and nothing happened.

Date Posted: May 16, 2007, 05:31:33 pm
Wait I think I see the problem let me try the script again.

Date Posted: May 16, 2007, 05:35:33 pm
No it comes up with the error.

07-05-16 15:26:30    Console Log Started
07-05-16 15:26:30 Loaded weapons mod "Default mod v1.4"
07-05-16 15:26:30 Welcome to Soldat 1.4.0
07-05-16 15:26:30 
  • Compiling Script ks.pas...

07-05-16 15:26:30 
  • Compiling Script Core.pas...

07-05-16 15:26:30 
  • Compiling Script NetworkCore.pas...

07-05-16 15:26:30 
  • Compiling Script AdminCore.pas...

07-05-16 15:26:30 
  • Compiling Script Read.pas...

07-05-16 15:26:30 
  • Compiling Script xsplit.pas...

07-05-16 15:26:30 
  • [Error] (170:24): Unknown identifier 'Text'

07-05-16 15:26:30 Shutting server...
07-05-16 15:26:30 Shutting down admin server...

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: Help script for ! commands
« Reply #5 on: May 16, 2007, 06:24:05 pm »
u should add that code in networkcore.pas, the procedure OnPlayerSpeak is at the end of that file i think
urraka

Offline Zyyn

  • Major(1)
  • Posts: 21
Re: Help script for ! commands
« Reply #6 on: May 16, 2007, 06:25:14 pm »
I still get the same error. And i don't know where the xsplit came from....

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: Help script for ! commands
« Reply #7 on: May 16, 2007, 06:32:55 pm »
hmm, open includes.txt and remove where it says xsplit.pas
urraka

Offline Zyyn

  • Major(1)
  • Posts: 21
Re: Help script for ! commands
« Reply #8 on: May 16, 2007, 06:36:24 pm »
Thats the problem there isn't one anywhere...in includes or in the script folder...

// All files specified below here will be
// compiled for use with any SoldatServer
// Scripts. Use // to mark a comment.
// Manual:
// http://enesce.com/help/

//SocketCore.pas
ks.pas
Core.pas
NetworkCore.pas
AdminCore.pas

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: Help script for ! commands
« Reply #9 on: May 16, 2007, 06:43:48 pm »
such a thing never happened to me
urraka