Raised This Month: $32 Target: $400
 8% 

[L4D2] Show Tank's HP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nataraja
Member
Join Date: Jan 2010
Old 02-01-2010 , 02:09   [L4D2] Show Tank's HP
Reply With Quote #1

Is there any plugins that simply show tank's health?

I don't want the plugins show every zombie's hp like this:
http://forums.alliedmods.net/showthread.php?t=107289
Just only Tank plz

Last edited by Nataraja; 02-01-2010 at 02:42.
Nataraja is offline
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 02-01-2010 , 14:52   Re: [L4D2] Show Tank's HP
Reply With Quote #2

Haven't tested, but should work
Attached Files
File Type: sp Get Plugin or Get Source (shownpchptankonly.sp - 2101 views - 7.2 KB)
__________________
M249-M4A1 is offline
Nataraja
Member
Join Date: Jan 2010
Old 02-02-2010 , 04:58   Re: [L4D2] Show Tank's HP
Reply With Quote #3

Thx u very much!!!!!
Nataraja is offline
Nataraja
Member
Join Date: Jan 2010
Old 02-02-2010 , 05:03   Re: [L4D2] Show Tank's HP
Reply With Quote #4

Warning 203, symbol is never used "g_sIncIncludeNPC"

It isn't work >"<

Last edited by Nataraja; 02-02-2010 at 22:36.
Nataraja is offline
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 02-03-2010 , 01:03   Re: [L4D2] Show Tank's HP
Reply With Quote #5

maybe this (i didnt edit much except make it only the tank)
Attached Files
File Type: sp Get Plugin or Get Source (shownpchptankonly.sp - 1503 views - 7.2 KB)
__________________
M249-M4A1 is offline
Nataraja
Member
Join Date: Jan 2010
Old 02-03-2010 , 02:50   Re: [L4D2] Show Tank's HP
Reply With Quote #6

It works, but it show up Survivor's and other infected's hp!!! >"<

I only want it show up tank's hp.

Is there any plugin that just simply show up tank's hp and who is acting the TANK??

Last edited by Nataraja; 02-03-2010 at 03:01.
Nataraja is offline
DieTeetasse
Senior Member
Join Date: Jul 2009
Old 02-03-2010 , 04:42   Re: [L4D2] Show Tank's HP
Reply With Quote #7

Not tested, just wrote it down in the university:
PHP Code:
#include <sourcemod>
#pragma semicolon 1

#define HUD_INTERVAL 1.0

new bool:TankAlive false;
new 
TankClient = -1;

public 
OnPluginStart()
{
    
HookEvent("tank_spawn"Tank_Spawn_Event);
    
HookEvent("player_death"Player_Death_Event);
}

public 
Action:Tank_Spawn_Event(Handle:event, const String:name[], bool:dontBroadcast)
{
    
TankClient GetClientOfUserId(GetEventInt(event"userid"));
    
TankAlive true;

    
CreateTimer(HUD_INTERVALHUD_TimerINVALID_HANDLETIMER_REPEAT);
}

public 
Action:Player_Death_Event(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    if (
client == TankClient)
    {
        
TankClient = -1;
        
TankAlive false;
    }
}

public 
Action:HUD_Timer(Handle:timer)
{    
    
ShowHUD();

    if(!
TankAlive) return Plugin_Stop;
    return 
Plugin_Continue;
}

ShowHUD()
{
    if (!
IsClientInGame(TankClient)) return;
    if (!
IsPlayerAlive(TankClient)) return;

    new 
String:text[128];
    new 
Handle:HUD CreatePanel();

    
DrawPanelText(HUD"Tank Info:");
    
DrawPanelText(HUD"##################");

    if (
IsFakeClient(TankClient)) text "Player: AI";
    else 
Format(textsizeof(text), "Player: %N"TankClient);

    
DrawPanelText(HUDtext);

    new 
health GetEntProp(TankClientProp_Send"m_iHealth");
    
Format(textsizeof(text), "Health: %d"health);

    
DrawPanelText(HUDtext);

    for(new 
client 1client MaxClients+1client++)
    {
        if (!
IsClientInGame(client)) continue;
        if (
IsFakeClient(client)) continue;
        if (
client == TankClient) continue;

        
SendPanelToClient(HUDclientHUDHandler3);
    }
}  


public 
HUDHandler(Handle:menuMenuAction:actionparam1param2)
{

__________________
DieTeetasse is offline
Nataraja
Member
Join Date: Jan 2010
Old 02-03-2010 , 08:35   Re: [L4D2] Show Tank's HP
Reply With Quote #8

some bug report:
1.When Tank player win the versus game and change to survivor, the Tank info. status won't stop!!!

2.SRCDS won't stop show up massage:
Quote:
Client index -1 is invalid
L 02/03/2010 - 211:16: [SM] Displaying call stack trace for plugin "show_tank_status.smx":
L 02/03/2010 - 211:16: [SM] [0] Line 43, show_tank_status.sp::ShowHUD()
L 02/03/2010 - 211:16: [SM] [1] Line 35, show_tank_status.sp::HUD_Timer()
L 02/03/2010 - 211:17: [SM] Native "IsClientInGame" reported: Client index -1 is invalid
L 02/03/2010 - 211:17: [SM] Displaying call stack trace for plugin "show_tank_status.smx":
L 02/03/2010 - 211:17: [SM] [0] Line 43, show_tank_status.sp::ShowHUD()
L 02/03/2010 - 211:17: [SM] [1] Line 35, show_tank_status.sp::HUD_Timer()
L 02/03/2010 - 211:17: [SM] Native "IsClientInGame" reported: Client index -1 is invalid
L 02/03/2010 - 211:17: [SM] Displaying call stack trace for plugin "show_tank_status.smx":
L 02/03/2010 - 211:17: [SM] [0] Line 43, show_tank_status.sp::ShowHUD()
L 02/03/2010 - 211:17: [SM] [1] Line 35, show_tank_status.sp::HUD_Timer()
...
...
Client index -1 is invalid
It is going to show up that massage every second!

3.When Tank is spawned, the admin menu can't use!

Last edited by Nataraja; 02-03-2010 at 08:39.
Nataraja is offline
DieTeetasse
Senior Member
Join Date: Jul 2009
Old 02-04-2010 , 03:07   Re: [L4D2] Show Tank's HP
Reply With Quote #9

Updated:
- fixed 1. (and 2.) by adding round end check
- changed behaviour for admins (hinttext) to prevent 3.
Attached Files
File Type: sp Get Plugin or Get Source (tankstatus.sp - 1493 views - 2.8 KB)
__________________
DieTeetasse is offline
Nataraja
Member
Join Date: Jan 2010
Old 02-04-2010 , 10:19   Re: [L4D2] Show Tank's HP
Reply With Quote #10

still have bug, I report in next page.
Attached Thumbnails
Click image for larger version

Name:	sshot-2.jpg
Views:	1765
Size:	44.7 KB
ID:	59089  

Last edited by Nataraja; 02-05-2010 at 04:40.
Nataraja 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:35.


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