Raised This Month: $12 Target: $400
 3% 

Progressive spawn protect


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Admin Commands       
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 04-02-2017 , 04:39   Progressive spawn protect
Reply With Quote #1

Progressive spawn protect

Descliption:
Primarily intended for AWP mod/maps in order to prevent instant kill on round start and player spawn if you set up freezetime to 0.
But you can use it for all mods(ZP,Biohazard,Public etc)

Cvars:
1. cs_damage_blocker_on_off = use this cvar to turn on/off the plugin for specific maps.
2. cs_damage_blocker_task = shows for how many seconds plugin will turn off spawn protection. Set this cvar depending on how long your freezetime is.

comment
Tested for a long time.No bugs,no lags and no crash.Works perfectly.
Attached Files
File Type: zip progressive spawn protect.zip (1.3 KB, 94 views)
File Type: sma Get Plugin or Get Source (amx_progressive_spawn_protect.sma - 694 views - 2.2 KB)
Krtola is offline
Send a message via Skype™ to Krtola
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 04-02-2017 , 07:05   Re: Progressive spawn protect
Reply With Quote #2

1.
Code:
new activated[33]

- It should be a bool
Code:
new bool:activated[33]

2.
Code:
set_task(0.5, "start_protect", protected)

- You don't need a task.

3.
Code:
cs_plugin_task    = register_cvar("cs_damage_blocker_task","5.0") set_task(get_pcvar_float(cs_plugin_task), "end_protect", protected)

- To make it easier for users, you can do this :
Code:
cs_plugin_task    = register_cvar("cs_damage_blocker_task","5") set_task(float(get_pcvar_num(cs_plugin_task)), "end_protect", protected)

4.
Code:
!is_user_connected(victim)

- Remove that, victim may be an entity (worldspawn) .

5. Use id + Task_ID format of tasks because many tasks with same ID can get messed up. Example :
Code:
#define TASK_ID 555 public TestFunction( id ) {        set_task( 1.0, "TaskTest", id+TASK_ID ) ; } public TaskTest( id ) {       id -= TASK_ID ;       client_print( id, print_chat, "id+Task_ID method !" ) ; }

6. - On client_putinserver reset the bool.

Code:
public client_putinserver( id ) {       activated[ id ] = false ; }
__________________

Last edited by edon1337; 04-02-2017 at 07:06.
edon1337 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 04-02-2017 , 07:43   Re: Progressive spawn protect
Reply With Quote #3

Quote:
Originally Posted by edon1337 View Post
...
1. It doesn't have to be tagged as bool, but it's alright for readability.

3. Doesn't matter, get_pcvar_num and get_pcvar_float will cast the cvar as needed.

5. It doesn't matter if you don't remove or change these tasks. In his case they don't have to be unique and nothing will get messed up.
klippy is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 04-02-2017 , 10:41   Re: Progressive spawn protect
Reply With Quote #4

Quote:
Originally Posted by edon1337 View Post
....
4. How can the the victim be world spawn in a "player" traceattack hook?
PartialCloning is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-02-2017 , 10:57   Re: Progressive spawn protect
Reply With Quote #5

4. And why should the world spawn be protected? o_O
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 04-02-2017 , 12:13   Re: Progressive spawn protect
Reply With Quote #6

Quote:
Originally Posted by KliPPy View Post
3. Doesn't matter, get_pcvar_num and get_pcvar_float will cast the cvar as needed.
3. I thought it would give a tag mismatch. Nvm.

Quote:
Originally Posted by PartialCloning View Post
4. How can the the victim be world spawn in a "player" traceattack hook?
Code:
RegisterHam(Ham_TraceAttack, "player", "TraceAttack_stuff")

Isn't 'player' the attacker's class name here?
__________________
edon1337 is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 04-02-2017 , 18:50   Re: Progressive spawn protect
Reply With Quote #7

"player" is the "victim".

What makes this spawn protection plugin "progressive"? There should be some way to indicate to the players a player has spawn protection like a glow.
PartialCloning is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 04-03-2017 , 04:39   Re: Progressive spawn protect
Reply With Quote #8

Quote:
Originally Posted by PartialCloning View Post
"player" is the "victim".

What makes this spawn protection plugin "progressive"? There should be some way to indicate to the players a player has spawn protection like a glow.
In America,in a hotel room on the window you can see the inscription that says:
PHP Code:
Do not jump out the windowyou can die. 
There is a message that informs players.
Its simplicity and infallibility in their work makes it progressive.
Krtola is offline
Send a message via Skype™ to Krtola
rautamiekka
Veteran Member
Join Date: Jan 2009
Location: Finland
Old 04-08-2017 , 14:17   Re: Progressive spawn protect
Reply With Quote #9

Quote:
Originally Posted by Krtola View Post
In America,in a hotel room on the window you can see the inscription that says:
PHP Code:
Do not jump out the windowyou can die. 
There is a message that informs players.
Its simplicity and infallibility in their work makes it progressive.
Frankly, I see no relation.
__________________
Links to posts I received Karma from:
Big thanks to all who gave Karma
rautamiekka is offline
Send a message via ICQ to rautamiekka Send a message via AIM to rautamiekka Send a message via MSN to rautamiekka Send a message via Yahoo to rautamiekka Send a message via Skype™ to rautamiekka
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 04-15-2017 , 09:35   Re: Progressive spawn protect
Reply With Quote #10

There are a lot of spawn/respawn protecton plugins.

Btw

Code:
public TraceAttack_stuff(victim, attacker, Float:damage, Float:direction[3], tracehandle, damagebits) {      if(!get_pcvar_num(cs_plugin_on_off) || !is_user_connected(victim) || !is_user_connected(attacker) || victim == attacker)     {         return HAM_IGNORED      }     if(activated[attacker])     {          return HAM_SUPERCEDE      }     return HAM_IGNORED  }
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:27.


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