[HL2:DM] Heartbeat

A place for requesting new Source.Python plugins to be made for your server.

Please request only one plugin per thread.
User avatar
Painkiller
Senior Member
Posts: 542
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

[HL2:DM] Heartbeat

Postby Painkiller » Mon Apr 13, 2020 8:59 am

Hello SourcePython Team and Community,

could somebody turn that into SP for me?


"es_heartbeat.txt"

Syntax: Select all

// ******************************
// Heartbeat V4.0 Beta
// for Valve Source Games.
// * Description:
// Can hear wounded players heartbeats.
// * Install instructions:
// <!-- m --><a class="postlink" href="http://forums.mattie.info/cs/forums/viewtopic.php?p=58954">http://forums.mattie.info/cs/forums/vie ... hp?p=58954</a><!-- m -->
// * Credits:
// Concept By: Murpher Written By: Venjax
// Edited Sounds by: Ace Rimmer - Thanks Bud!
// ENV_Blood code stolen from Einlazers - Thanks man!
// Special Thanks: MBchrono, Mattie!, Whore, & ljfsp
// * Requirements:
// EventScripts v1.2.1 or higher
// ******************************

block config
{
es_xsetinfo hbemit 1 // Set to 1 to hear others heartbeats. 0 to hear only your own.
es_xsetinfo slowhealth 60 // Set this variable for first beat
es_xsetinfo fasthealth 15 // Set this variable for second beat
es_xsetinfo hb_bleed 1 // Set to 1 to bleed during the fast heartbeat.
es_xsetinfo hb_bleedout 1 // Set this to amount of damage to lose after player starts to bleed.
}

// DO NOT EDIT BELOW THIS LINE DOING SO WILL VOID WARRANTY AND TECHNICAL SUPPORT. Smile

block load
{
es_xsetinfo mygame 0
es_getgame mygame
es_xsetinfo gmeinfo "CCSPlayer.baseclass.m_iHealth"
if ("Defeat" in server_var(mygame)) then es_xsetinfo gmeinfo "CDODPlayer.baseclass.m_iHealth"
if ("Deathmatch" in server_var(mygame)) then es_xsetinfo gmeinfo "CHL2MP_Player.baseclass.baseclass.m_iHealth"
es_xsetinfo myhealth 0
es_xsetinfo togvar 0
es_xsetinfo togvar2 0
es_xsetinfo stmid 0
es_xsetinfo ven_hb_ver "v4.0"
es_xmakepublic ven_hb_ver
es_xsetinfo hbexists 0
es_xsetinfo hb_shadox 0
es_xexists hbexists keygroup hbtoggle
if (server_var(hbexists) equalto 1) then es_xkeygroupdelete hbtoggle
es_xkeygroupload hbtoggle |heartbeat
es_xexists hbexists keygroup hbeaters
if (server_var(hbexists) equalto 1) then es_xkeygroupdelete hbeaters
es_xkeygroupcreate hbeaters
es_xloadevents addons/mattie_eventscripts.res
es_xdoblock heartbeat/config
if (server_var(hb_bleed) equalto 1) do
{
es_regcmd _hb_dobleed heartbeat/dobleed "internal command to add blood to heartbeat"
}
else do
{
es_regcmd _hb_dobleed heartbeat/nobleed "internal command for no blood"
}
}

event es_map_start
{
downloadable sound/hb/fastbeat.mp3
downloadable sound/hb/slowbeat.mp3
es_xdelayed 10 es_xdoblock heartbeat/beatstart
es_xkeygroupdelete hbtoggle
es_xkeygroupload hbtoggle |heartbeat
}

event round_start
{
es_xforeachkey hb_users in hbeaters "es_xdoblock heartbeat/shadox"
}

event player_spawn
{
es es_xexists hbexists key hbeaters event_var(userid)
if (server_var(hbexists) equalto 0) do
{
es es_xexists togvar2 key hbtoggle event_var(es_steamid)
if (server_var(togvar2) equalto 0) do
{
es es_xkeycreate hbeaters event_var(userid)
es es_xkeysetvalue hbeaters event_var(userid) hb 1
}
}
}

event player_death
{
es es_xexists hbexists key hbeaters event_var(userid)
if (server_var(hbexists) equalto 1) then es_xkeydelete hbeaters event_var(userid)
}

event player_disconnect
{
es es_xexists hbexists key hbeaters event_var(userid)
if (server_var(hbexists) equalto 1) then es_xkeydelete hbeaters event_var(userid)
}

block beatstart
{
es_xforeachkey hb_users in hbeaters "es_xdoblock heartbeat/beat"
es_xdelayed 1.1 es_xdoblock heartbeat/beatstart
}

block beat
{
es es_xgetplayerprop myhealth server_var(hb_users) server_var(gmeinfo)
if (server_var(myhealth) <= server_var(slowhealth)) do
{
if (server_var(myhealth) > server_var(fasthealth)) do
{
if (server_var(hbemit) equalto 1) do
{
es_emitsound player server_var(hb_users) hb/slowbeat.mp3 1.0 1.0
}
else do
{
es es_xcexec server_var(hb_users) playgamesound hb/slowbeat.mp3
}
}
else do
{
if (server_var(myhealth) > 1) do
{
if (server_var(hbemit) equalto 1) do
{
es_emitsound player server_var(hb_users) hb/fastbeat.mp3 1.0 1.0
_hb_dobleed
}
else do
{
es es_xcexec server_var(hb_users) playgamesound hb/fastbeat.mp3
_hb_dobleed
}
}
}
}
}

event player_say
{
if (event_var(text) equalto "!heartbeat") do
{
es es_xexists togvar key hbtoggle event_var(es_steamid)
if (server_var(togvar) equalto 0) do
{
es es_xtell event_var(userid) [Heartbeat] You will not hear your own heartbeat.
if (server_var(hbemit) notequalto 0) do
{
es es_xtell event_var(userid) [Heartbeat] You WILL still hear other's heartbeat.
}
es es_xkeycreate hbtoggle event_var(es_steamid)
es es_xkeysetvalue hbtoggle event_var(es_steamid) nobeat 1
es es_xexists hbexists key hbeaters event_var(userid)
if (server_var(hbexists) equalto 1) then es_xkeydelete hbeaters event_var(userid)
}
else do
{
es es_xtell event_var(userid) [Heartbeat] You will now hear your own heartbeat again.
es es_xkeydelete hbtoggle event_var(es_steamid)
es es_xkeycreate hbeaters event_var(userid)
es es_xkeysetvalue hbeaters event_var(userid) hb 1
}
es_xkeygroupsave hbtoggle |heartbeat
}
}

event unload
{
es_xkeygroupsave hbtoggle |heartbeat
es_xkeygroupdelete hbtoggle
es_xkeygroupdelete hbeaters
}

block dobleed
{
es es_xfire server_var(hb_users) env_blood kill
es es_xgive server_var(hb_users) env_blood
es es_xfire server_var(hb_users) env_blood addoutput "spawnflags 13"
es es_xfire server_var(hb_users) env_blood addoutput "amount 10000"
es es_xfire server_var(hb_users) env_blood EmitBlood
if (server_var(hb_bleedout) greaterthan 0) do
{
es es_xmath myhealth - server_var(hb_bleedout)
es es_xsetplayerprop server_var(hb_users) server_var(gmeinfo) server_var(myhealth)
}
}

block nobleed
{
//Nothing here!
}

block shadox
{
es es_xgetuserid hb_shadox server_var(hb_users)
if (server_var(hb_shadox) equalto 0) then es_xkeydelete hbeaters server_var(hb_users)
}



"es_hbtoggle_db.txt"

Code: Select all

"hbtoggle"
{
   "STEAM_0:1:13527267"
   {
      "nobeat"      "1"
   }
   "STEAM_0:0:12379922"
   {
      "nobeat"      "1"
   }
   "STEAM_0:1:5062330"
   {
      "nobeat"      "1"
   }
   "STEAM_0:0:5031723"
   {
      "nobeat"      "1"
   }
   "STEAM_0:1:73619277"
   {
      "nobeat"      "1"
   }
   "STEAM_0:1:11412613"
   {
      "nobeat"      "1"
   }
   "STEAM_0:1:5065710"
   {
      "nobeat"      "1"
   }
   "STEAM_0:0:12887093"
   {
      "nobeat"      "1"
   }
   "STEAM_0:1:33597831"
   {
      "nobeat"      "1"
   }
   "STEAM_0:0:80209958"
   {
      "nobeat"      "1"
   }
   "STEAM_0:1:22541232"
   {
      "nobeat"      "1"
   }
   "STEAM_0:1:18699109"
   {
      "nobeat"      "1"
   }
   "STEAM_0:1:39824176"
   {
      "nobeat"      "1"
   }
   "STEAM_0:1:14786612"
   {
      "nobeat"      "1"
   }
   "STEAM_0:0:8063502"
   {
      "nobeat"      "1"
   }
   "STEAM_0:0:29324209"
   {
      "nobeat"      "1"
   }
   "STEAM_0:1:5238382"
   {
      "nobeat"      "1"
   }
   "STEAM_0:0:37116066"
   {
      "nobeat"      "1"
   }
   "STEAM_0:1:16245200"
   {
      "nobeat"      "1"
   }
   "STEAM_0:0:22011549"
   {
      "nobeat"      "1"
   }
   "[U:1:35751098]"
   {
      "nobeat"      "1"
   }
   "[U:1:185003008]"
   {
      "nobeat"      "1"
   }
   "[U:1:395801539]"
   {
      "nobeat"      "1"
   }
   "[U:1:63022354]"
   {
      "nobeat"      "1"
   }
   "[U:1:155082594]"
   {
      "nobeat"      "1"
   }
   "[U:1:190107688]"
   {
      "nobeat"      "1"
   }
   "[U:1:79614141]"
   {
      "nobeat"      "1"
   }
   "[U:1:201432531]"
   {
      "nobeat"      "1"
   }
   "[U:1:851189843]"
   {
      "nobeat"      "1"
   }
   "[U:1:228203257]"
   {
      "nobeat"      "1"
   }
}


Thanks in Advance
User avatar
Painkiller
Senior Member
Posts: 542
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2:DM] Heartbeat

Postby Painkiller » Wed May 13, 2020 6:46 am

Is there already an attempt to do this?
User avatar
Painkiller
Senior Member
Posts: 542
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2:DM] Heartbeat

Postby Painkiller » Mon May 18, 2020 7:03 am

Hello, who would be so kind and rewrite this plugin?

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 5 guests