AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Hostage Protection[ V 1.8 ] (https://forums.alliedmods.net/showthread.php?t=242948)

HamletEagle 06-27-2014 09:12

Hostage Protection[ V 1.8 ]
 
3 Attachment(s)

Hostage Protection 1.8
Release: 27.06.2014 | Last Update: 20.02.2015

Table of Contents

Description top

This plugin has a simple purpose, to stop players from killing hostages. It will work only in hostage maps. You can set punishments ( with cvars ) for players that kill hostages. It will also block any damage on a hostage, this mean he won't die but you will think more next time when you want to kill one.

Feature:
  • pause plugin when you don't run a hostage map
  • block damage, not just punish the player
  • more cvars to customize it
  • you can punish a player in many ways, you decide how

Installation top

To install the plugin:
  1. Download the resources from this post.
  2. Put hostage_protection.amxx in addons/amxmodx/plugins
  3. Open addons/amxmodx/configs/plugins.ini and add at the end of this file hostage_protection.amxx
  4. You can put the sma file into addons/amxmodx/sources but this is not mandatory.
  5. Put hostage_protection.txt in addons/amxmodx/data/lang
  6. Restart the server/change map.
Cvars top

This cvars allow you to turn on/off most of the features and to control the way in which the plugin works.
  • hp_punishment:
    • Allow you to decide in which way a player will be punished.
      To enabled damage on hostages you have to disable this plugin, read the cvar above.
    • 0 - just block damage | 1 - slap with x damage | 2 - slay | 3 - ban | 4 - random stuffs

    • Random stuffs: he lose 50% of his health/money or he lose all weapons.
  • hp_slap_value | hp_ban_time:
    • You can decide slap value/ban time
    • Slap: If it's 100 player will die | If it's 0 it will have no effect
    • Ban:Time that a player remain banned | 0 mean permanent
  • hp_showblood:
    • Determines if the blood will be show when attacking a hostage.
    • 1 - show blood | 0 don't show blood.
  • hp_blockteam:
    • Determines what team can't attack hostages
    • t - tero | c - ct | b - both
ChangeLog top
  • V 0.1:
    • Initial release
  • V 0.2:
    • Removed an useless variable.
      Added a new option to the punishment cvar: no punishment ( 0 value )
  • V 0.3:
    • Removed display cvar+message
    • Plugin is now working on cs_assault too
    • Block he grenade damage.
    • Remove constant for entities
  • V 0.4:
    • Arranged the code
    • Little optimizations
  • V 0.5:
    • Remove hp_status cvar
    • Added some check in CHostage::TakeDamage
  • V 0.6:
    • Optimized the code and fixed some potential bugs.
Downloads top
  • 0.1 version: 18 downloads
  • 0.2 version: 37 downloads
  • 0.3 version: unknow downloads
  • 0.4 version: 69 downloads
  • 0.5 version: 24 downloads
  • 0.7 version: 180 downloads

EthicalHacker007 06-27-2014 09:17

Re: You won't kill hostages anymore
 
Nice, but I think it's been made before or something like this.

HamletEagle 06-27-2014 09:17

Re: You won't kill hostages anymore
 
Quote:

Originally Posted by EthicalHacker007 (Post 2158131)
Nice, but I think it's been made before or something like this.

Idk if it was done before, but I was needing it so I made it.

Searched a bit, and this is the difference between mine and others:
  • pause plugin when you don't run a hostage map
  • block damage, not just punish the player
  • more cvars to customize it
  • you can punish a player in many ways, you decide how

ANTICHRISTUS 06-27-2014 16:58

Re: You won't kill hostages anymore
 
Quote:

Originally Posted by EthicalHacker007 (Post 2158131)
Nice, but I think it's been made before or something like this.

maybe do you mean this: Stop Killing The %&¤#ing Hostages.

DruGzOG 06-27-2014 20:52

Re: You won't kill hostages anymore
 
This plugin has a much better alternative in my opinion. Good job.

EthicalHacker007 06-28-2014 00:21

Re: You won't kill hostages anymore
 
Yeah, yours is better.

red_bull2oo6 06-28-2014 09:10

Re: You won't kill hostages anymore
 
PHP Code:

public plugin_cfg ( ) {
    
    
    if ( 
get_pcvar_num Cvars [  CVAR_STATUS ] ) == ) {
        
        
log_amx "Plugin paused" )
        
pause "a" )
        
    }
    


what happens if server starts with the cvar value 0 than i want to change it to 1.
for example i want it always deactivated and only when i need/want, to activate it.

i think you could return FMRES_IGNORED; in TraceAttack forward if the cvar is 0.


also i saw this ( you always declare a new variable to use it in one switch.. )

PHP Code:

new iNum random_num )    
switch ( 
iNum ) {
    
-->
    
switch ( 
random_num ) ) { 


HamletEagle 06-28-2014 09:28

Re: You won't kill hostages anymore
 
Quote:

Originally Posted by red_bull2oo6 (Post 2158698)
PHP Code:

public plugin_cfg ( ) {
    
    
    if ( 
get_pcvar_num Cvars [  CVAR_STATUS ] ) == ) {
        
        
log_amx "Plugin paused" )
        
pause "a" )
        
    }
    


what happens if server starts with the cvar value 0 than i want to change it to 1.
for example i want it always deactivated and only when i need/want, to activate it.

i think you could return FMRES_IGNORED; in TraceAttack forward if the cvar is 0.


also i saw this ( you always declare a new variable to use it in one switch.. )

PHP Code:

new iNum random_num )    
switch ( 
iNum ) {
    
-->
    
switch ( 
random_num ) ) { 


1. Cvar is default 1, no problem in this.
2. FMRES_INGORED in a ham forward ? Are you serious ? Anyway, it's better to pause it, we avoid that some code to execute when it shouldn't.
3. Where do you saw that "I always declare a new variable to use it in one switch" ? But, you are right here, updated.

Edit: fw is not a fakemeta tag. I understand what you want to say with plugin_cfg but it's ok, because it will be auto-disabled on non-hostage maps, you don't need to care to activate/deactivate it and you have no reason to keep the cvar to 0 if you want to run it into current map.

red_bull2oo6 06-28-2014 09:43

Re: You won't kill hostages anymore
 
uops, my bad, i confused the ham with forward ( because u called it fw_HostageTraceAttack ) ;;).
return HAM_IGNORED; then.

it seems that you have not understood what i mean about that 'little story' from plugin_cfg.
that feature does not allow me to instantly activate/deactivate the plugin via cvar. it requires sv rr/ map change

nvm.

ArabicMan 06-28-2014 10:29

Re: You won't kill hostages anymore
 
Good to make them when some one hit them form T or CT team no damage done to them punishment not good. Good job


All times are GMT -4. The time now is 13:20.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.