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

Spawn Protection


Post New Thread Reply   
 
Thread Tools Display Modes
Cooltad
Veteran Member
Join Date: Apr 2008
Old 03-07-2010 , 12:15   Re: Spawn Protection
Reply With Quote #41

Probably doesn't cause any crashes, use "if (IsClientInGame(client))" on the line it's talking about.
__________________
Please, give me some rep if you found what I posted useful. :]
Cooltad is offline
Malak101
Member
Join Date: May 2009
Old 03-07-2010 , 13:03   Re: Spawn Protection
Reply With Quote #42

Quote:
Originally Posted by Malak101
L 03/07/2010 - 16:19:15: [SM] [0] Line 72, /home/groups/alliedmodders/forums/files/3/1/7/8/4/36454.attach::timer_PlayerProtect()
Quote:
Originally Posted by Cooltad
Probably doesn't cause any crashes, use "if (IsClientInGame(client))" on the line it's talking about.
I searched "timer_PlayerProtect" in SpawnProtection.sp and found these 2:

Quote:
CreateTimer(GetConVarFloat(cvarProtectTime), timer_PlayerProtect, client);
Quote:
public Action:timer_PlayerProtect(Handle:timer, any:client)
Could you please be more exact about where the changes should be made?
Malak101 is offline
turk89
Member
Join Date: Jul 2010
Old 07-15-2010 , 22:44   Re: Spawn Protection
Reply With Quote #43

Edit: Problem solved.

Last edited by turk89; 07-16-2010 at 05:14.
turk89 is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 09-12-2012 , 15:40   Re: Spawn Protection
Reply With Quote #44

This plugin causes crashes - and infinite timer loops/leaks, esp. if you disable the plugin, and load a new map, it will continue to loop forever. It's better to remove the timer restore health loops/hooks, and just make it edit the player's entity to make them take no damage. When protection expires, edit the entity again so that they take damage. This also prevents enemy players from doing things like charging up buff banner/mmmmpf in tf2.

Last edited by friagram; 09-12-2012 at 15:41.
friagram is offline
Wazman
AlliedModders Donor
Join Date: Oct 2012
Location: Unknown place ????
Old 12-17-2012 , 15:21   Re: Spawn Protection
Reply With Quote #45

Hey, Is there a way you can make it so that you can set the protection on a specific Team.
Wazman is offline
luki1412
Veteran Member
Join Date: Oct 2008
Location: OnPluginStart()
Old 06-28-2013 , 19:04   Re: Spawn Protection
Reply With Quote #46

Hello guys, I thought that someone might want this version so Im posting it here.

Error PrintToChat should be fixed and I have also added red/blue glow on spawn protected players. I have tested this on tf2 and its working well.

EDIT: Changed colors to orange/light blue on protected players. Fixed bug where you use "Spy!" voice command on someone and it will play sound that spy is around. It will still not work when players are colored.

EDIT2: Removed unnecessary checks. Fixed an error, being spammed in the console/logs.

EDIT3: Added some checks to ignore client 0, fixed some typos and updated some code.
Attached Files
File Type: sp Get Plugin or Get Source (Spawn_Protection.sp - 481 views - 3.2 KB)
__________________

Last edited by luki1412; 11-21-2013 at 18:39. Reason: Update
luki1412 is offline
maxolahird
Veteran Member
Join Date: Dec 2012
Old 04-11-2014 , 09:20   Re: Spawn Protection
Reply With Quote #47

Please crymsom this still do damage even if not having effect on target... for example if my attack has freezing skills it does freeze him even when protected x.x

Last edited by maxolahird; 04-11-2014 at 09:28.
maxolahird is offline
SM9
Veteran Member
Join Date: Sep 2013
Location: United Kingdom
Old 05-25-2014 , 18:48   Re: Spawn Protection
Reply With Quote #48

You should NOT be setting a timer directly on a client, instead you should parse his userid. If that client disconnects while the timer is still running its going to hook itself to any other client that takes his index. For this reason I'm surprised its even approved.

I have fixed the errors and also made the messages less spammy.
Attached Files
File Type: sp Get Plugin or Get Source (SpawnProtection.sp - 596 views - 3.0 KB)
SM9 is offline
Reply



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 00:48.


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