help hud

Coding Help/Re-API Supported
Post Reply
User avatar
Luxurious
Mod Tester
Mod Tester
Egypt
Posts: 177
Joined: 6 years ago
Location: Egypt
Contact:

help hud

#1

Post by Luxurious » 4 years ago

Raheem created this plugin .. and i tried to add hud in this plugin but i fail
Here is the cod :

Code: Select all

#include <zombie_escape>
#include <ze_levels>


#define TASK_SHOWHUD 2020
#define REPEAT_TIME 60.0 
#define ID_SHOWHUD (taskid - TASK_SHOWHUD)

 
new g_pCvarZombieInfectNum, g_pCvarXP
new g_iInfections[33] 
new g_MsgSync
 
const Float:HUD_SPECT_X = 0.01
const Float:HUD_SPECT_Y = 0.3
const Float:HUD_STATS_X = 0.01
const Float:HUD_STATS_Y = 0.3


public plugin_init()
{
    register_plugin("ZM Rewards", "1.0", "Eg.")
   
    g_pCvarZombieInfectNum = register_cvar("ze_infect_humans_num", "5")
    g_pCvarXP = register_cvar("ze_xp_reward", "1")
    
    g_MsgSync = CreateHudSyncObj()
 
}
public client_putinserver(id)
{
    if(is_user_hltv(id) || is_user_bot(id))
        return
	
        set_task(1.0, "Show_Hud", id+TASK_SHOWHUD, _, _, "b")
    }

public Show_Hud(taskid)
{  
    new iPlayer = ID_SHOWHUD
    
        if (!is_user_alive(iPlayer))

        iPlayer = pev(iPlayer, pev_iuser2)
       
        if (ze_is_user_zombie(iPlayer))
            return

	    if(iPlayer != ID_SHOWHUD) 
        {
            set_hudmessage(0, 255, 0, HUD_SPECT_X, HUD_SPECT_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
            ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync, "^nInfections : %d/5", g_iInfections[iPlayer])
        }
        else if (ze_is_user_zombie(iPlayer))
        {
            set_hudmessage(0, 255, 0, HUD_STATS_X, HUD_STATS_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
            ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync, "^nInfections : %d/5", g_iInfections[ID_SHOWHUD])
        }
        else
        { 
            set_hudmessage(0, 255, 0, HUD_STATS_X, HUD_STATS_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
            ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync, "^nInfections : %d/5", g_iInfections[ID_SHOWHUD])
        }
    }
     
	    
public ze_user_humanized (id) 
{
	g_iInfections[id] = 0	 
}

public ze_user_infected(iVictim, iInfector)
{
    if (g_iInfections[iInfector] >= get_pcvar_num(g_pCvarZombieInfectNum))
    {
        ze_set_user_xp(iInfector, ze_get_user_xp(iInfector) + get_pcvar_num(g_pCvarXP))
        g_iInfections[iInfector] = 0
    }
    else
    { 
        g_iInfections[iInfector]++
    }
}

 
DRK Zombie-Escape V1.6
IP : 81.169.153.129:27015

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 2 guests