Author Topic: ESA2.11 - Scripting help  (Read 678 times)

0 Members and 1 Guest are viewing this topic.

Offline Mighty

  • Camper
  • ***
  • Posts: 276
ESA2.11 - Scripting help
« on: January 28, 2009, 08:14:08 pm »
Hi all

Well, I hope some of U, scripters, still remember and use ESA made by Raindeer, loong time ago.

I need some help with it. I spent a few days trying to solve these problems so please don't tell me that I didn't try or sth like that.

1st, easier - how does $read_file() work? I tried to use some of below, but none of them works.
Code: [Select]
$if($isequal(%text%,!file),
$send(/say File:)
$read_file(C:\Soldat\esadata\vsrx.txt)
$read_file(vsrx.txt)
$read_file(vsrx)
,)

-----------------
2nd
I'd like to have something like "CWMode". When its ON it would kick spec who doesnt speak on teamchat but in public, disturbing players.
So it has to discover if msg starts with ^, if player is spec and if cwmode is on.

Code: [Select]
$if($isequal(%line%,/cwmode on),$sset(cwmode,1),)
$if($isequal(%line%,/cwmode off),$sset(cwmode,0),)
Above works

Code: [Select]
$if($and($isnotequal(%cwmode%,0),$isequal(%player%sid%team%,TM_SPEC),$isnotequal($substr(%text%,1,1),^)),
 $send(/kick $redo(%player%sid%id%))
,)
Above doesn't. When I turn CWMode on and say anything on spec i get something like this:

Quote from: ESA
/kick 1 (83.5.64.180)
02:02:59   [KE] Mighty `Ce is admin and cannot be kicked.
02:03:00   /kick 1
02:03:00   [KE] Mighty `Ce is admin and cannot be kicked.
02:03:00   /kick 1
02:03:00   [KE] Mighty `Ce is admin and cannot be kicked.
02:03:01   /kick 1
02:03:01   [KE] Mighty `Ce is admin and cannot be kicked.
02:03:01   /kick 1
02:03:01   [KE] Mighty `Ce is admin and cannot be kicked.
...
...

But the problem is I don't have an idea how to make this script work just ONCE for each message sent from spec. Now it works all the time till i disconnect ESA, change team or use /cwmode off...

-----------------------------

Problems:
1. How does $read_file work
2. How to make ESA "see" if spec talk on teamchat or not (with this script it doesn't)
3. How to make it work once for each sentence said by spec

Cheers,
Mighty
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline iDante

  • Veteran
  • *****
  • Posts: 1967
Re: ESA2.11 - Scripting help
« Reply #1 on: January 29, 2009, 01:26:25 am »
For the second two I'd use a server-side script. I can write that up pretty quickly if you want, just say the word.

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: ESA2.11 - Scripting help
« Reply #2 on: January 29, 2009, 05:22:22 am »
What do U mean by server-side script?

BTW I don't have permission to modify servers files, just ARSSE/ESA...
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID