AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [L4D2] Show Tank's HP (https://forums.alliedmods.net/showthread.php?t=117431)

Nataraja 02-01-2010 02:09

[L4D2] Show Tank's HP
 
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

M249-M4A1 02-01-2010 14:52

Re: [L4D2] Show Tank's HP
 
1 Attachment(s)
Haven't tested, but should work

Nataraja 02-02-2010 04:58

Re: [L4D2] Show Tank's HP
 
Thx u very much!!!!!

Nataraja 02-02-2010 05:03

Re: [L4D2] Show Tank's HP
 
Warning 203, symbol is never used "g_sIncIncludeNPC"

It isn't work >"<

M249-M4A1 02-03-2010 01:03

Re: [L4D2] Show Tank's HP
 
1 Attachment(s)
maybe this (i didnt edit much except make it only the tank)

Nataraja 02-03-2010 02:50

Re: [L4D2] Show Tank's HP
 
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??

DieTeetasse 02-03-2010 04:42

Re: [L4D2] Show Tank's HP
 
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)
{



Nataraja 02-03-2010 08:35

Re: [L4D2] Show Tank's HP
 
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 - 21:31:16: [SM] Displaying call stack trace for plugin "show_tank_status.smx":
L 02/03/2010 - 21:31:16: [SM] [0] Line 43, show_tank_status.sp::ShowHUD()
L 02/03/2010 - 21:31:16: [SM] [1] Line 35, show_tank_status.sp::HUD_Timer()
L 02/03/2010 - 21:31:17: [SM] Native "IsClientInGame" reported: Client index -1 is invalid
L 02/03/2010 - 21:31:17: [SM] Displaying call stack trace for plugin "show_tank_status.smx":
L 02/03/2010 - 21:31:17: [SM] [0] Line 43, show_tank_status.sp::ShowHUD()
L 02/03/2010 - 21:31:17: [SM] [1] Line 35, show_tank_status.sp::HUD_Timer()
L 02/03/2010 - 21:31:17: [SM] Native "IsClientInGame" reported: Client index -1 is invalid
L 02/03/2010 - 21:31:17: [SM] Displaying call stack trace for plugin "show_tank_status.smx":
L 02/03/2010 - 21:31:17: [SM] [0] Line 43, show_tank_status.sp::ShowHUD()
L 02/03/2010 - 21:31: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!

DieTeetasse 02-04-2010 03:07

Re: [L4D2] Show Tank's HP
 
1 Attachment(s)
Updated:
- fixed 1. (and 2.) by adding round end check
- changed behaviour for admins (hinttext) to prevent 3.

Nataraja 02-04-2010 10:19

Re: [L4D2] Show Tank's HP
 
1 Attachment(s)
still have bug, I report in next page.


All times are GMT -4. The time now is 09:14.

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