Author Topic: Salute Mod v3.1 [minor update]  (Read 10071 times)

This is my first add-on that I'm releasing on this board, so here it is. Feel free to look over the code for any suggestions/etc.

Important note: If you downloaded this add-on before 5/18/2015, I highly recommend you redownload this add-on since you'll be missing out on a major update.

Salute Mod


Ever wanted to salute someone? Now you can! Simply use the command /salute (time) (uses default time if no time is inputted) to salute for the duration.

This mod comes with several RTB prefs you can use:
Salute Enabled: allow/disallow saluting (admins can also use /togglesaluting)
NEW: Simple Mode: simple emote style salute mode (ignores any time input)
NEW: Salute Count Command: how many times you've saluted is saved (not persistant)
NEW: Force Salute: Admins can now /forcesalute (target) (time). Note that administrators can override any forced salute, while players cannot.
Announce Salutes: allow/disallow announcing of salutes (ex: Stealth Commander is saluting!)
Announce Salute Time: show time in the above message (ex: Stealth Commander is saluting for five seconds!)
Announce Salute On End: tells everyone when you stop saluting (ex: Stealth Commander stopped saluting.))
Echo Salutes: whether or not to echo salutes to console if it's being publicly announced (highly recommended)
Salute Default Time (not pictured): the time you salute for if you do not input a time (just /salute)
Salute Max Time: the longest time you can salute
Salute Timeout: how long you must wait until you can salute again (ex: if you salute for 3 seconds and the timeout is 5 seconds, after you stop saluting you must wait 2 additional seconds to salute again)

For those not using RTB, you can set these global variables:
$Pref::Server::SaluteMod::Enabled (true or false)
$Pref::Server::SaluteMod::SimpleMode (true or false)
$Pref::Server::SaluteMod::SaluteCountCmd (true or false)
$Pref::Server::SaluteMod::ForceSalute (true or false)
$Pref::Server::SaluteMod::Announce (true or false)
$Pref::Server::SaluteMod::AnnounceTime (true or false)
$Pref::Server::SaluteMod::AnnounceOnEnd (true or false)
$Pref::Server::SaluteMod::EchoMsg (true or false)
$Pref::Server::SaluteMod::DefaultTime (integer 1 - 300 recommended)
$Pref::Server::SaluteMod::MaxTime (integer 2 - 300 recommended)
$Pref::Server::SaluteMod::Timeout (integer 3 - 300 recommended)

Also included: /salutehelp command, /salutecount command, /resetsalute command (same as /salute 0)

New updates!
-tiny code changes; removal of an unneeded function
-completely revamped the code; now uses several specific functions rather than all in the main server command
-cancelling salutes will also cancel any pending salute schedules - aka if you salute for 10 seconds, cancel in one second, and resalute for 15 seconds, you won't stop saluting too early
-timeout period starts after a player stops saluting
-"emote" mode uses default time
-somewhat annotated code

Older updates:
-fixed packaging forget up (no idea how this happened)
-important fix: salutes now cannot bypass the timeout and be spammed
-now plays animations on different slots
-now echos salutes to console if announce saluting is enabled
-minor default preference changes
-removed isNumber function (did not perform as intended & replaced)
-announcement colors are nicer

Current Status/Version: v3.1

Note: Using items while saluting isn't recommended; the animations to salute will probably get messed up. Besides from that, there shouldn't be any issues.

Credits:
Xalos - NumToWord.cs support script

And what you came to the thread for:
Download Now (v3.1)
alt mediafire download
Current file SHA256 as of 5/29/2015 9:45 PM release (use onlinemd5.com to confirm): 508A5EDFEFF4A29DD4FB85EBB32C7 833ED3D268A53FCA16788EC1813D5 9A7539
« Last Edit: January 17, 2016, 08:16:24 PM by QuadStorm »

I salute you for this.


This...is...AWESOME !!!!

Ehm I mean...

salute soldier!






You should make different variations, otherwise this is still good.
basically national socialist salute.

I'm saluting you followed by a shake of the hand. Thankyou soldier!

/Salute




I asked for this..

Thank you god.