Spawn Protection

Created On
N/A
Updated On
N/A
Total Views
734
Total Downloads
3
Maintainer
Gamemann

A simple SourceMod Spawn Protection plugin that was developed for Counter-Strike: Source and Counter-Strike: Global Offensive, but should work in other games as well. What's neat about this plugin is it uses SDKHooks to block damage and includes an option to stop spawn protection when the victim fires their weapon.

ConVars

  • sm_sp_announce - When enabled, the attacker will receive chat messages (if enabled per client) that the victim is protected (Default 1).
  • sm_sp_time - The amount of time to protect each player on spawn (Default 5.0).
  • sm_sp_on_fire - When enabled, if the victim fires their weapon before the spawn protection time runs out, it will remove their protection (Default 1).
  • sm_sp_exclude_afk - If 1, users who are AFK will not be spawn protected.

Commands

  • sm_rspnotify - This toggles protected notifications per attacker/client via client cookies.

Natives

For developers, the following natives are supported.

1/** 2 * Checks whether the client is protected or not. 3 * 4 * @param iClient Client's index. 5 * 6 * @return boolean 7 */ 8native bool IsSpawnProtected(int iClient); 9 10/** 11 * Notifies the attacker that the victim is AFK. 12 * 13 * @param iAttacker The attacker's client index. 14 * @param iVictim The victim's client index. 15 * 16 * @return boolean Returns true on success and false otherwise. 17 */ 18native bool NotifyAttacker(int iAttacker, int iVictim);

You may include the plugin with the following assuming scripting/include/RSP.inc exists.

1#include <RSP>

Credits