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

Subplugin Submission [ZP] Health Reminder (Nemesis + Sniper + Survivor + Assassin + Bombardier)


Post New Thread Reply   
 
Thread Tools Display Modes
ghost95v
Senior Member
Join Date: Apr 2014
Location: somewhere in universe
Old 01-05-2015 , 11:22   Re: [ZP] Health Reminder (Nemesis + Sniper + Survivor + Assassin + Bombardier)
Reply With Quote #51

I think you forgot to "RegisterHam" Fwd_PlayerKilled_Pre... yes ?

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <zombie_plague_advance>

#define TASK_HEALTH 1994

new cvar_e1cvar_e2cvar_e3cvar_e4 
new g_SyncHud

public plugin_init() 
{
    
register_plugin("[ZP] Health Reminder (4 in 1)""1.0""zmd94")
    
    
RegisterHam(Ham_Spawn"player""Fwd_PlayerSpawn_Post"1)
    
    
cvar_e1 register_cvar("zp_hm_nemesis""1")
    
cvar_e2 register_cvar("zp_hm_survivor""1")
    
cvar_e3 register_cvar("zp_hm_assasin""1")
    
cvar_e4 register_cvar("zp_hm_sniper""1")
    
    
g_SyncHud CreateHudSyncObj()
}

public 
Fwd_PlayerSpawn_Post(id)
{
    if (
task_exists(id+TASK_HEALTH))
        
remove_task(id+TASK_HEALTH)
}

public 
Fwd_PlayerKilled_Pre(victimattackershouldgib)
{
    if (
task_exists(victim+TASK_HEALTH))
        
remove_task(victim+TASK_HEALTH)
}

public 
zp_round_started(modeid)
{
    if(
get_pcvar_num(cvar_e1) && zp_is_nemesis_round())
    {
        
set_task(6.0"Task_ShowHealth"id+TASK_HEALTH__"b"
    }
    else if (
get_pcvar_num(cvar_e2) && zp_is_survivor_round())
    {
        
set_task(6.0"Task_ShowHealth"id+TASK_HEALTH__"b"
    }
    else if (
get_pcvar_num(cvar_e3) && zp_is_assassin_round())
    {
        
set_task(6.0"Task_ShowHealth"id+TASK_HEALTH__"b"
    }
    else if (
get_pcvar_num(cvar_e4) && zp_is_sniper_round())
    {
        
set_task(6.0"Task_ShowHealth"id+TASK_HEALTH__"b"
    }
}

public 
Task_ShowHealth(id)
{
    
id -= TASK_HEALTH
    
if(get_pcvar_num(cvar_e1) && zp_get_user_nemesis(id))
    {
        
set_hudmessage(02550, -1.00.2006.02.00.00.0, -1)
        
ShowSyncHudMsg(0g_SyncHud"Nemesis still has %d health points!"get_user_health(id))
    }
    else if (
get_pcvar_num(cvar_e2) && zp_get_user_survivor(id))
    {
        
set_hudmessage(02550, -1.00.2006.02.00.00.0, -1)
        
ShowSyncHudMsg(0g_SyncHud"Survivor still has %d health points!"get_user_health(id))
    }
    else if (
get_pcvar_num(cvar_e3) && zp_get_user_assassin(id))
    {
        
set_hudmessage(02550, -1.00.2006.02.00.00.0, -1)
        
ShowSyncHudMsg(0g_SyncHud"Assassin still has %d health points!"get_user_health(id))
    }
    else if (
get_pcvar_num(cvar_e4) && zp_get_user_sniper(id))
    {
        
set_hudmessage(02550, -1.00.2006.02.00.00.0, -1)
        
ShowSyncHudMsg(0g_SyncHud"Sniper still has %d health points!"get_user_health(id))
    }
    else
        
remove_task(id+TASK_HEALTH)

__________________
ghost95v is offline
Send a message via Skype™ to ghost95v
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-05-2015 , 11:28   Re: [ZP] Health Reminder (Nemesis + Sniper + Survivor + Assassin + Bombardier)
Reply With Quote #52

You're right. I will fix all of the codes. ;)

Edit: I have fixed the code.

Last edited by zmd94; 01-05-2015 at 11:42.
zmd94 is offline
weez
Junior Member
Join Date: Jul 2014
Old 01-12-2015 , 15:03   Re: [ZP] Health Reminder (Nemesis + Sniper + Survivor + Assassin + Bombardier)
Reply With Quote #53

How do I change to show messages in chat ?
__________________
weez is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-12-2015 , 20:24   Re: [ZP] Health Reminder (Nemesis + Sniper + Survivor + Assassin + Bombardier)
Reply With Quote #54

Weez, just use this:

https://forums.alliedmods.net/showpo...3&postcount=40
zmd94 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 08:04.


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