Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma semicolon 1
- #include <sourcemod>
- #include <sdktools>
- #define PLUGIN_VERSION "1.00"
- public Plugin:myinfo =
- {
- name = "[L4D2] Round End HP Restore",
- author = "DeathChaos25",
- description = "When transitioning into the next map, if a survivor has less than 79 HP, this plugin will heal them for 50 HP, removing the need to kill injured survivors.",
- version = "1.0",
- }
- public OnPluginStart()
- {
- HookEvent("map_transition", Event_maptransition);
- }
- public Action:Event_maptransition(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new maxplayers = GetMaxClients();
- for (new i = 1; i <= maxplayers; i++)
- {
- if (IsClientInGame(i))
- {
- if (GetClientTeam(i) == 2 && IsPlayerAlive(i))
- {
- new health = GetEntProp(i, Prop_Send, "m_iHealth");
- if (health < 79)
- {
- SetEntProp(i, Prop_Send, "m_iHealth", 80);
- SetEntProp(i, Prop_Send, "m_currentReviveCount", 0);
- SetEntProp(i, Prop_Send, "m_bIsOnThirdStrike", 0);
- SetEntProp(i, Prop_Send, "m_isGoingToDie", 0);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment