// ---------------------------------------------------------------------------
// StatsMe 2.8.3 Config Pack [16 June, 2004]
// ---------------------------------------------------------------------------
// This file is part of StatsMe (See README for more information).
// Copyright 2002 - 2004 UnitedAdmins (www.unitedadmins.com)
// Project originally created by OLO (http://olo.counter-strike.pl)
// ---------------------------------------------------------------------------
// Please read the manual and the forums carefully before altering this file!
// The Manual is located at http://docs.unitedadmins.com/statsme/
// The Forum can be found at http://forums.unitedadmins.com/
// ---------------------------------------------------------------------------
// Hostage Script

sm_mode2 set uwxy

sm_menu "Hostage EndRound Ann.\\y\\R{sm_mode2&u?ON:OFF}" "sm_mode2 {sm_mode2&u?remove:set} u"
sm_menu "Hostage Kill\\y\\R{sm_mode2&w?ON:OFF}" "sm_mode2 {sm_mode2&w?remove:set} w"
sm_menu "Hostage Rescue\\y\\R{sm_mode2&x?ON:OFF}" "sm_mode2 {sm_mode2&x?remove:set} x"
sm_menu "Hostage Grab\\y\\R{sm_mode2&y?ON:OFF}" "sm_mode2 {sm_mode2&y?remove:set} y"


alias set_kk "sm_sayformat 0 200 100 -1 0.25 0 6 6 0.5 0.5 1"
alias set_sb "sm_sayformat 200 100 0 0.01 0.91 2 0.02 6 0.01 0.1 1"

sm_reg "SM_MapStart" "sm_mode2 {currentmap&cs_?set:remove} uwxy" ade // on non cs maps this script is automaticly disabled

sm_reg "TextMsg u 2" "set_sb;sm_tell * \'The Terrorists prevented the Counter-Terrorists from rescuing the hostages\'" ade "2=#Hostages_N" // hostage not rescued
sm_reg "TextMsg u 2" "{%.hosr=1}set_sb;sm_tell * \'All hostages rescued.\'" ade "2=#All_Hostages_R" // all hostages rescued

sm_reg "TextMsg w 2" "set_sb;sm_tell * \'A hostage was killed by {p.name}...\'" bcde "2=#Killed_Hostage" 

sm_reg "SM_RoundStart x 2" "{%.hosr=0}" bcde
sm_reg "TextMsg x 2" "{%.hosr=1}" ade "2=#All_Hostages_R" // all hostages rescued
sm_reg "Money x 2" "{%.hossi={p.name}}" bcde "2=1" // save who got cash lastly (if there will be rescue then that player did it)
sm_reg "SendAudio x 2" "{%.hosr?#}set_sb;sm_tell * \'Hostage rescued by {%.hossi}...\'" ade "2=%!MRAD_rescued" // hostage rescued

sm_reg "ResetHUD y 2" "{%.hosb{p.id}={{gmtime}+15}}" bde // make that script won't check money after respawn for 15 sec.
sm_reg "Money y 2" "{%.hosb{p.id}>{gmtime}?#}{{{V1}-{%.hoss{p.id}}}=150?:#}set_sb;sm_tell * \'{p.name} got the hostage!\'" bcdeg "2=1" // got +150 (hostage grab reward)
sm_reg "Money y 2" "{%.hoss{p.id}={V1}}" bde // save money for future compare