Garry's Mod

Garry's Mod

25 ratings
Simple revive kit
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Weapon
Addon Tags: Roleplay, Realism
File Size
Posted
Updated
1.454 MB
Dec 6, 2022 @ 10:23am
Mar 15, 2024 @ 6:40am
24 Change Notes ( view )

Subscribe to download
Simple revive kit

In 3 collections by Pyth0n11
Collection du serveur Vendémiaire GDC
401 items
Vendémiaire Médiéval le fléau nocturne
205 items
Vendémiaire Milsim / Apocalypse Zombie
150 items
Description
The simple revive kit is a addon allowing to create a state between life and death, the unconscious state.
A player who drops to 0 life is knocked unconscious.
If he still takes too much damage, he dies and must wait a while before he can respawn.
The module includes a way to take his pulse (to know if he is unconscious or dead), a way to move the body and a way to revive him if he is not dead.
For admins/superadmins, there are 4 commands
For its 4 commands you can use * for all and ^ for yourself.
/srk_revive (or /srk_rev) and /srk_respawn (or /srk_res) to force a revive/respawn.
/srk_can_revive (or /srk_crev) and /srk_kill to set player revivable or not when he is unconscious.

This addon contains 3 weapons located in the simple revive kit category.
- Take pulse: Allows you to take the pulse of conscious and unconscious players (including ragdolls).
- Drag body: Allows to move unconscious players (also ragdolls).
- Simple revive kit: Allows unconscious players to be revived only if they are alive.


Config
How to use : Just put a command in you're console (client or server).

srk_language | The addon language : english or french.
srk_enable_unconsious_grey_effect | Should enable the grey effect when unconscious : 0 = disable, 1 = enable
srk_can_respawn_time | Time before a player can respawn after death in seconds.
srk_force_respawn_time | Time before a player is force to respawn after a death in seconds.
srk_revive_time | Time of the revive action when a player attempt to revive an other.
srk_damage_instant_kill | Amount of damage(once at 0hp) beyond which the player is instantly killed. : 0 = disable.
srk_admin_can_acess_config | Do admin can change the config : 0 = disable, 1 = enable.
srk_admin_can_use_commands | Do admin can use the /srk_respawn and /srk_revive command : 0 = disable, 1 = enable.
srk_drag_body_can_drag_normal_ragdolls | Allow the weapon "Drag body" to drag normal ragdolls (not only those of srk) : 0 = disable, 1 = enable.
srk_health_gived_back_when_revive | Amount (in %) of health gived back after a revive.
srk_health_gived_back_when_station_revive | Amount (in %) of health gived back after a revive made by a revive station.
srk_base_revive_station_range | The range of the station, how far can be a patient to be revive (base = 100).
srk_can_revive_station_revive_dead | Can revive station revive the dead. 0 = false | 1 = true
srk_base_revive_station_cooldown | The cooldown (in seconds) between 2 successful station's revive (base = 3).
srk_invulnerability_time | The time (in seconds) of invulnerability following the unconsciousness (base = 1).
srk_srk_dead_state_enable | Do the dead state is enable, dead state is the state when a player is unconscious and dead so he can't be revive with the revive kit. 0 = false | 1 = true.
srk_ragdoll_health | The unconscious player's ragdoll health, when it fall to 0 the player is set to the death state and can't be revive with the revive kit (base = 25).


For extensions
I add 1 global var.

- Shared : SIMPLE_REVIVE_KIT (boolean).
It's allways true. It can be use to know if the SRK addon is on the client/server.

I add some arguments to the player.

- Server | player.srk_is_unconscious (boolean)
Tell if the player in unconscious.
True if unconscious, False if not unconscious, nil if the player never been unconscious.

- Server | player.srk_silent_death(boolean)
Tell if the player got silent kill.
True if silent kill, False if not silent kill, nil if the player never get silent kill.

- Server | player.srk_is_dead (boolean)
Tell if the player is unconscious and dead.
True if dead, False if not dead, nil if the player never been unconscious.

- Server | player.srk_last_death_infos (table)
Keep some usefull infos about the player's last death.
player.srk_last_death_infos["death_time"] | The time get with CurTime() when the player fell unconscious.
player.srk_last_death_infos["invulnerability_end"] | The time when the player's invulnerability stop.
player.srk_last_death_infos["color"] (Color) | The player's color before he got unconscious.
player.srk_last_death_infos["model"] (string) | The player's model before he got unconscious.
player.srk_last_death_infos["material"] (string) | The player's material before he got unconscious.
player.srk_last_death_infos["scale"] (number) | The player's scale before he got unconscious.
player.srk_last_death_infos["ammos"] (table(ammoid, amount)) | A table of all player's ammo before he got unconscious.
player.srk_last_death_infos["weapons"] (table(weapon_class)) | A table of all player's weapons before he got unconscious.
player.srk_last_death_infos["bodygroup"] (table(bodygroup_id, bodygroup_value)) | A table of all player's bodygroup before he got unconscious.
player.srk_last_death_infos["can_respawn_at"] (number) | The time when the player can respawn (curtime + convar srk_can_respawn_time)
player.srk_last_death_infos["ragdoll"] (ragdoll) | The unconscious player's ragdoll

I add 3 global functions
- Server | srk_respawn_player(ply)
Function to respawn an unconscious player.
Agr :
ply, the targeted player.

- Server | srk_revive_player(ply, revive_health)
Function to revive an unconscious player with the gived health.
Agr :
ply, the targeted player.
revive_healt, the ammount of health to give back to the player.

- Server | srk_remove_last_death_ragdoll(ply)
Function to remove player's ragdoll.
Agr :
ply, the targeted player.

I add 3 hooks than you can use for create some extensions

- Server | srk_respawn_player(ply)
Call when a player do a srk respawn, a command respawn or a admin respawn (call at the end of the function).
Args :
ply, the respawned player.
Return :
No return

- Server | srk_revive_player(ply, revive_health)
Args :
Call when a player is revive with the revive kit or with a command (call at the end of the function).
ply, the revived player.
revive_health, the health gived back to the player.
Return :
No return

- Server | srk_remove_last_death_ragdoll(ply, ragdoll)
Args :
Call when the unconscious player's ragdoll is remove (call at the begining of the function).
ply, the ragdoll's player.
ragdoll, the ragdoll that will be remove .
Return :
No return


License

This addon is under GPLv3.
That mean that you can use and modify this addon but if you distribute a other addon based on mine you have to put it under GPLv3 too.
GPLV3 : https://www.gnu.org/licenses/gpl-3.0.en.html
26 Comments
Reiisen Nov 4, 2024 @ 9:26am 
So far, the only revive addon that actually works.
Pyth0n11  [author] Aug 29, 2024 @ 8:48am 
That a good idea, i will try to do it when i got a bit of time ;)
Finsku Aug 29, 2024 @ 8:45am 
can you make an option where you can stand up on your own if you havent been dead checked?
Bounty Jan 23, 2024 @ 1:07am 
that would be really nice
Pyth0n11  [author] Jan 21, 2024 @ 6:21pm 
Actualy, there is no way but i will try to add a cofig command to do it soon :)
Bounty Jan 18, 2024 @ 2:49pm 
how can i switch off that if the player is dead and someone shoots at the corpse he is not completely dead but remains unconscious ?
Pyth0n11  [author] Jan 9, 2024 @ 8:20am 
Works fine for me. In what gamemode are you using it ?
bbak_tsar #fixtf2 Jan 9, 2024 @ 12:31am 
no
Pyth0n11  [author] Jan 8, 2024 @ 12:52pm 
Do you have an other addon that can do something on death ?
Like an other revive or a death ragdoll addon ?
bbak_tsar #fixtf2 Jan 8, 2024 @ 7:48am 
there are 2 bodies when i die. What should i do?