Raised This Month: $59 Target: $400
 14% 

Anti Spawn Kill V1.5 (Updated 15/7/2017 )


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay        Approver:   HamletEagle (32)
eyal282
Veteran Member
Join Date: Aug 2011
Old 08-29-2016 , 19:34   Anti Spawn Kill V1.5 (Updated 15/7/2017 )
Reply With Quote #1

I must say, I was pretty amazed that I couldn't find this type of plugin, so I had to script one.

Cvars:
amx_antisk_enable - Enables the plugin ( Default: 1)
amx_antisk_type - 0 = gives godmode on spawn, 1 = prevents damage from players ( personally used in surf to allow damage to self a.k.a fall damage ( Default: 1)
amx_antisk_timer - For how long will the SK protection be active ( Default: 1)
amx_antisk_shoot - Whether shooting or second attack ( mostly sniper ) will disable SK Protection ( Default: 1)

Changelog:

V1.0:
Created the plugin.

V1.1:
Made it better.

V1.2:
Added a check if the victim is connected in the event of damage.

V1.3:
As Hamlet told me to, added the task in plugin init.

V1.4:
More fixes that Hamlet told me to do.

V1.5
This time a fix by Hamlet himself.
Attached Files
File Type: sma Get Plugin or Get Source (AntiSpawnKill.sma - 1253 views - 4.6 KB)

Last edited by eyal282; 07-15-2017 at 13:52.
eyal282 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 08-29-2016 , 19:55   Re: Anti Spawn Kill
Reply With Quote #2

I think this plugin can be better. I like what you made with the PreThink function
__________________

Last edited by EFFx; 08-29-2016 at 19:55.
EFFx is offline
Send a message via Skype™ to EFFx
eyal282
Veteran Member
Join Date: Aug 2011
Old 08-30-2016 , 11:20   Re: Anti Spawn Kill
Reply With Quote #3

Quote:
Originally Posted by EFFx View Post
I think this plugin can be better. I like what you made with the PreThink function
Thanks

Why should I be shot by a godmode?

How can you make this plugin better? Post something

Last edited by eyal282; 08-30-2016 at 11:32.
eyal282 is offline
icimaro1337
Junior Member
Join Date: Jan 2016
Location: Moldova, Chisinau
Old 08-30-2016 , 11:40   Re: Anti Spawn Kill
Reply With Quote #4

remove client_PreThink and use hamsandwich(ham_weapon_primaryattack, ham_weapon_secondaryattack)
icimaro1337 is offline
Send a message via Skype™ to icimaro1337
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 08-30-2016 , 17:50   Re: Anti Spawn Kill
Reply With Quote #5

Here's a suggestions:

1. Remove player_PreThink(id) and add set_task with protection time for check if player has used the primattack or secattack.

Example:

PHP Code:
set_task(1.0,"CheckAttacks",id+2016,_,_,"a",get_pcvar_num(protecttime)) 
And check if player has disconnect and remove his time.

PHP Code:
remove_task(id+2016
2. If you're using return HAM_SUPERCEDE for block player receive damage, dont need add set_user_godmode(), i think you made it for block others plugins give godmode for players, right?

3. A check at HamBurger_Spawn(id) will not be bad. Add is_user_alive().

For me, thats all.
__________________

Last edited by EFFx; 08-30-2016 at 17:57.
EFFx is offline
Send a message via Skype™ to EFFx
eyal282
Veteran Member
Join Date: Aug 2011
Old 08-30-2016 , 20:55   Re: Anti Spawn Kill
Reply With Quote #6

1. No idea how to do that, can you show me?

2. Some prefer to allow fall damage, some don't, I allow them to make these choices.

3. Adding is_user_alive in hamburger somehow caused bugs if used in a DM ( meant for DM ), fixed it in a different method already.

For icimaro, for every single weapon?

Last edited by eyal282; 08-30-2016 at 20:57.
eyal282 is offline
safetymoose
Senior Member
Join Date: Feb 2015
Old 08-30-2016 , 21:49   Re: Anti Spawn Kill
Reply With Quote #7

Setting godmode is enough, i dont see why you had to go through all that trouble with prethink.

And i think the best method for this is the one used in the plugin zp50_spawn_protection from the Zombie Plague 5.0 collection.
safetymoose is offline
pupdebox
Senior Member
Join Date: Feb 2016
Location: Wakanda
Old 08-30-2016 , 22:55   Re: Anti Spawn Kill
Reply With Quote #8

Plugin:
https://forums.alliedmods.net/showthread.php?t=1886

There is also spawn protection feature in amx_super plugin i dont know if its older version or not. (Read:https://forums.alliedmods.net/showthread.php?t=228928).
Thats why he needs to use Ham_TakeDamage. amx_super could turn the godmode off depending on its timer.

Last edited by pupdebox; 08-30-2016 at 22:56.
pupdebox is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-30-2016 , 23:51   Re: Anti Spawn Kill
Reply With Quote #9

You should always check if the user is alive in Ham_Spawn since it is called at least once before the player can actually be spawned alive.
__________________
fysiks is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 08-31-2016 , 15:05   Re: Anti Spawn Kill
Reply With Quote #10

Quote:
Originally Posted by fysiks View Post
You should always check if the user is alive in Ham_Spawn since it is called at least once before the player can actually be spawned alive.

When I did that, the the plugin didn't work when I connected, only after that, what I've done now will prevent ( or hide, no idea ) all bugs.
eyal282 is offline
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 15:52.


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