Raised This Month: $18 Target: $400
 4% 

[TF2] Smarter Spawns - Spawn Protection


Post New Thread Reply   
 
Thread Tools Display Modes
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Old 04-12-2013 , 15:03   Re: [TF2] Smarter Spawns - Spawn Protection
Reply With Quote #21

Quote:
Originally Posted by island55 View Post
a couple questions, would this work for custom maps? and would I set a cvar to 0 or 1 for regular damage?
https://forums.alliedmods.net/showpo...38&postcount=1
__________________
DarthNinja is offline
island55
Senior Member
Join Date: Aug 2010
Location: charleston
Old 04-12-2013 , 17:59   Re: [TF2] Smarter Spawns - Spawn Protection
Reply With Quote #22

thanks,











for not answering my questions.
island55 is offline
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Old 04-13-2013 , 14:48   Re: [TF2] Smarter Spawns - Spawn Protection
Reply With Quote #23

Quote:
Originally Posted by island55 View Post
thanks,











for not answering my questions.
Thanks,









for not reading my post:

Quote:
Originally Posted by DarthNinja View Post
  • smarter_spawns_damage_inspawn
    • The damage percentage players inside spawn will take from players outside.
    • Min: 0.0
    • Max: 2.0
    • Default: 0.25 (or 25% of total damage)
  • smarter_spawns_damage_outsidespawn
    • The damage percentage players outside spawn will take from players inside.
    • Min: 0.0
    • Max: 2.0
    • Default: 0.50 (or 50% of total damage)
Quote:
Originally Posted by DarthNinja View Post

Notes:
This plugin uses the func_respawnroom entity to detect if a player is inside or outside of spawn. If your map doesn't have them or is sloppy with them, it's your problem. Don't whine when it doesn't do anything.
__________________
DarthNinja is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-13-2013 , 15:07   Re: [TF2] Smarter Spawns - Spawn Protection
Reply With Quote #24

I can only think of a few maps it wouldn't work on:

  1. Any arena map (for obvious reasons)
  2. cp_obscure_remake_ugc_rc2 (missing func_respawnroom)
Having said that, some arena maps DO have func_respawnroms. I know arena_ravine does, for example... or at least the version included with the Source SDK does.
__________________
Am I back? Well, we'll see.

Last edited by Powerlord; 04-13-2013 at 15:08.
Powerlord is offline
island55
Senior Member
Join Date: Aug 2010
Location: charleston
Old 04-13-2013 , 15:57   Re: [TF2] Smarter Spawns - Spawn Protection
Reply With Quote #25

it all makes sense now that it's pink.
island55 is offline
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Old 04-13-2013 , 16:00   Re: [TF2] Smarter Spawns - Spawn Protection
Reply With Quote #26

Quote:
Originally Posted by island55 View Post
it all makes sense now that it's pink.
Fabulous
__________________
DarthNinja is offline
lyric
Veteran Member
Join Date: Sep 2012
Old 07-01-2013 , 12:36   Re: [TF2] Smarter Spawns - Spawn Protection
Reply With Quote #27

i know your description says players being attacked by on both sides take reduced/increased damage but what if a scout runs by respawn with the intel and someone shoots him with a gun from inside spawn with damage increased to 150% for shooting outside of spawn does that mean the scout takes 150% of the damage even though he's not attacking anyone inside the respawn?
__________________
lyric is offline
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Old 07-01-2013 , 20:03   Re: [TF2] Smarter Spawns - Spawn Protection
Reply With Quote #28

Yes
__________________
DarthNinja is offline
The_Hairy_Baboon
Junior Member
Join Date: Oct 2011
Old 05-01-2014 , 17:37   Re: [TF2] Smarter Spawns - Spawn Protection
Reply With Quote #29

So the map I'd like to run this on does not have the properly flagged func_resapwnroom. I believe it has a nobuild part to it though. Is that something that I could modify within the .sp file to protect func_nobuild areas of the map, or do maps typically have nobuild all over them (or does the game self nobuild when there isn't enough area to place upon)?

Scratch that, realized my question/problem was answered by what grot posted. Now I jsut gotta figure out how to compile the adjusted code, only started learning how ot install mods a few days ago.

EDIT: If i'm correct, I could stop anyone from taking damage (besides self) in their own spawn with:

Code:
if (IsInSpawn[victim] && victim != attacker){
damage = 0.0; return Plugin_Changed;
}
Unfortunately, this means that someone who noclips into enemy spawn can shoot people outside of that specific spawn area, but be unkillable. Is there any way to get SDKHooks to recognize which team's spawn they are in?

EDIT: Solved.

change the conditional statements (for attacker/victim locations) to:
Code:
if (IsInSpawn[victim] && victim != attacker)
	{
		damage = 0.0;
		return Plugin_Changed;
	}
and then modify the SpawnStartTouch and SpawnStopTouch functions to compare player's class to spawn room's class.
Code:
public SpawnStartTouch(spawn, client)
{
	// Make sure it is a client and not something random
	if (client > MaxClients || client < 1)
		return;	// Not a client

	if (IsClientConnected(client) && IsClientInGame(client) && (GetEntProp(spawn, Prop_Data, "m_iTeamNum") == GetClientTeam(client)))
		IsInSpawn[client] = true;
}

public SpawnEndTouch(spawn, client)
{
	if (client > MaxClients || client < 1)
		return;

	if (IsClientConnected(client) && IsClientInGame(client)  && (GetEntProp(spawn, Prop_Data, "m_iTeamNum") == GetClientTeam(client)))
		IsInSpawn[client] = false;
}

Last edited by The_Hairy_Baboon; 05-01-2014 at 19:42.
The_Hairy_Baboon is offline
MaloModo
Veteran Member
Join Date: Aug 2008
Old 03-10-2016 , 21:47   Re: [TF2] Smarter Spawns - Spawn Protection
Reply With Quote #30

Would it be possible to expand this plugin so that, say people firing out of spawn take the damage dealt and vice versa.
__________________
www.anticheatgamers.com - The REAL Gaming Experience.
MaloModo 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 01:42.


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