Skip to content

gamemann/Spawn-Protection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Banner

Description

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.

/**
 * Checks whether the client is protected or not.
 * 
 * @param iClient Client's index.
 * 
 * @return boolean
 */
native bool IsSpawnProtected(int iClient);

/**
 * Notifies the attacker that the victim is AFK.
 * 
 * @param iAttacker The attacker's client index.
 * @param iVictim The victim's client index.
 * 
 * @return boolean Returns true on success and false otherwise.
 */
native bool NotifyAttacker(int iAttacker, int iVictim);

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

#include <RSP>

Installation

You'll want to compile the source code (scripting/SpawnProtection.sp). Afterwards, copy/move the compiled SpawnProtection.smx file into the server's addons/sourcemod/plugins directory.

Credits

About

A simple SourceMod Spawn Protection plugin that was developed for Counter-Strike: Source and Counter-Strike: Global Offensive.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published