etpub_printf.lua
The etpub and NoQuarter Enemy Territory mods have a shortcuts replacement feature.
Some keys inside square brackets ([]) are replaced by values.
This script does the same for etpro.
Supported commands are say,
say_team,
say_buddy,
say_teamnl,
vsay and vsay_team.
See below for some examples.
Known keys in etpub/nq are:
- [a]
-
last player who gave you ammo currently not working, just returns
*unknown* - [d]
-
last player who killed you
- [h]
-
last player who gave you health currently not working, just returns
*unknown* - [k]
-
last player you killed
- [l]
-
your location (letter,number) - currently not really working, feature request for etpro filed :-) When it's done, it will give the location name from the server's
maps/<mapname>_loc.datif it exists, else the(letter, number)map coordinates from stock ET.Currently it just returns the world coords in map units
- [n]
-
your name
- [r]
-
last player who revived you
- [p]
-
last player you looked at not working, probably never will ...
- [s]
-
health remaining
- [w]
-
name of current weapon
- [t]
-
ammo for current weapon
We ([!!!]Harlekin, bennz and /me) added the following keys:
- [m]
-
name of the last player who was revived by you
- [x]
-
health of last killer - don't ask me why
x... I just took this from the first version of this script :-) - [c]
-
current player class
Both health replacements ([s] and [x]) will return 0 if the health value is below that,
i.e.
you will not know if a player is gibbed or just waiting for a revive.
Examples
To test this simply do a say on the server:
\say "I'm a [c] with [w] ([t] ammo),
I have [s] health"
\vsay_team Medic "Need a medic,
^1[s]^5 health left!" result: Global voice sound: I need a medic and a custom text: Need a medic,
15 health left!
bind x "vsay negative Stop killing me,
[d]" result: Global voice sound: Negative/No,
and a custom text: Stop killing me,
[!!!]Harlekin
bind x "vsay_team thanks Thanks for the Team-Kill,
[d]!" result: Team voice sound: Thanks,
and a custom text: Thanks for the Team-Kill,
[!!!]Harlekin!
Thanks
Thanks to [!!!]Harlekin and bennz. Bennz did the first version of this script, which I rewrote completely ;-). He also helped debugging.




