Half-Life 2

Half-Life 2

Emergency Healing Function
Qwazzy  [开发者] 2024 年 11 月 23 日 上午 8:11
The Script
cfg/custom_scripts/11
alias QEMS "echo [QEMS] Version 2;unbind n;exec qems/spawnents;QEMSBEGIN" // The player is frozen in place, the suit speaks, and HP is tested alias QEMSBEGIN "echo [QEMS] Healing Begins;ent_fire qw_sm modifyspeed 0;wait 20;play hl1\fvox\automedic_on;wait 1500;ent_fire qw_pp requestplayerhealth;wait 20;ent_fire qw_c compare" // If HP is less than 30, give a health vial and repeat the HP check // If HP is 30 or more, proceed alias QEMSHEAL "echo [QEMS] HP low, healing 10HP;give item_healthvial;wait 500;ent_fire qw_pp requestplayerhealth;wait 20;ent_fire qw_c compare" // Player is now at acceptable HP, proceeding alias QEMSNOHEAL "echo [QEMS] HP at acceptable level;play items/medshotno1.wav;wait 1000;QEMSEND" // Player is informed the wait is over, they can move again, and the keybind is re-enabled alias QEMSEND "echo [QEMS] Suit Recharged;play hl1\fvox\power_restored;ent_fire qw_sm modifyspeed 1;ent_fire !player enableflashlight;exec qems/killents;bind n QEMS" // Initial keybind on map load bind n QEMS
cfg/qems/spawnents
// Creates a logic_playerproxy for reading player HP on demand ent_create logic_playerproxy targetname qw_pp playerhealth"qw_c,setvalue" // Creates a logic_compare to compare current HP to a set value (in this instance, 29) ent_create logic_compare targetname qw_c comparevalue 29 onlessthan"qw_pcc,command,QEMSHEAL" onequalto"qw_pcc,command,QEMSHEAL" ongreaterthan"qw_pcc,command,QEMSNOHEAL" // Creates the point_clientcommand used to give the player a health vial ent_create point_clientcommand targetname qw_pcc // Creates the player_speedmod used to freeze the player in place ent_create player_speedmod targetname qw_sm echo [QEMS] 4 entities spawned
cfg/qems/killents
ent_fire qw_pp* kill ent_fire qw_pcc* kill ent_fire qw_c* kill ent_fire qw_sm* kill echo [QEMS] All QEMS Entities killed
最后由 Qwazzy 编辑于; 2024 年 11 月 23 日 上午 10:24