Raised This Month: $ Target: $400
 0% 

Show number alive on enemy team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GrannyHunter
New Member
Join Date: Nov 2014
Old 11-10-2014 , 20:51   Show number alive on enemy team
Reply With Quote #1

Hi, new here, but looking for assistance with a script for Team Fortress 2. In game, if you press the tab button it will open the scoreboard. On the scoreboard, if a players name is darkened it means they are dead (this displays even for the enemy team). However, pressing tab takes up the whole screen and is time consuming in a competitive environment. Is there a way for me to display a number on my HUD that shows how many players are alive on the enemy team?
Thanks in advance.
GrannyHunter is offline
thecount
Veteran Member
Join Date: Jul 2013
Old 11-11-2014 , 10:59   Re: Show number alive on enemy team
Reply With Quote #2

PHP Code:
#include <sourcemod>
#include<sdktools>

public OnPluginStart(){
RegConsoleCmd("sm_alive"Cmd_Alive"");
}

public 
Action:Cmd_Alive(clientargs){
if(
GetClientTeam(client) > 1){
new 
teamID 0teamCount 0;
if(
GetClientTeam(client)==2){
teamID 3;
}else{
teamID 2;
}
for(new 
i=1;i<=MaxClients;i++){
if(
IsClientInGame(i) && GetClientTeam(i) == teamID && IsPlayerAlive(i)){
teamCount++;
}
}
PrintCenterText(client"Other team has %d players alive."teamCount);
}
return 
Plugin_Handled;

thecount is offline
GrannyHunter
New Member
Join Date: Nov 2014
Old 11-11-2014 , 20:43   Re: Show number alive on enemy team
Reply With Quote #3

Thanks, but is it possible to do this as just a HUD modification and not with SM?
GrannyHunter is offline
sim242
AlliedModders Donor
Join Date: Dec 2012
Location: England
Old 11-12-2014 , 03:45   Re: Show number alive on enemy team
Reply With Quote #4

You have to use sourcemod. You can't adjust the in-game HUD and force players to download it as that would affect their HUD directly for every other server they play on.

You could change it to use a timer that runs continuously showing a hint box with the enemy players alive but you can't change game files.
__________________
Steam - Sim
Request a private plugin
Not accepting requests at this time
sim242 is offline
Send a message via Skype™ to sim242
jballou
Member
Join Date: Jul 2013
Old 11-29-2014 , 04:59   Re: Show number alive on enemy team
Reply With Quote #5

I created a plugin for Insurgency that shows the number of enemy players remaining, you could just shorten the timer to 5 seconds and it'd stay in place. Bear in mind I am new to SourceMod so the code may not be the best, but you're welcome to it.
https://bitbucket.org/jballou/insurg...t.sp?at=master
jballou is offline
turtsmcgurts
SourceMod Donor
Join Date: Jul 2011
Old 11-29-2014 , 06:30   Re: Show number alive on enemy team
Reply With Quote #6

There's a way to do it indirectly, but at a great cost. We did this a long time ago so the details will be a bit fuzzy, but I think we made a couple custom fonts that were green/red squares and changed the hud element that draws people on the scoreboard to use it in a new position.

You lose the ability to see peoples names because, at least back then, you can't duplicate elements, only replace them. So you're sacrificing seeing the names of people in the server on the scoreboard in order to see how many people are dead/alive outside of it.

I lost the screenshots I had of the real thing, but here is a paint edit that shows exactly what it looked like. Assume here that the other team has 4 dead and yours has 2. Of course we stopped using it because it's too much of a hassle, it's easier to just keep track by looking at the death counter and having a good understanding of the respawn times.
turtsmcgurts 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 06:46.


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