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

Help / Support [ZP][Help] need help to HUD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Andreita
BANNED
Join Date: Apr 2012
Old 05-01-2012 , 19:01   [ZP][Help] need help to HUD
Reply With Quote #1

Someone Know how to put IN HUD ... RANK & LEVEL & EXP ? FOR THIS PLUGIN?

https://forums.alliedmods.net/showthread.php?t=162895

THIS its my code

PHP Code:
/*================================================================================
    
    ----------------------------
    -*- [ZP] HUD Information -*-
    ----------------------------
    
    This plugin is part of Zombie Plague Mod and is distributed under the
    terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
    
================================================================================*/

#include <amxmodx>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <zp50_class_human>
#include <zp50_class_zombie>
#define LIBRARY_NEMESIS "zp50_class_nemesis"
#include <zp50_class_nemesis>
#define LIBRARY_ASSASSIN "zp50_class_assassin"
#include <zp50_class_assassin>
#define LIBRARY_SURVIVOR "zp50_class_survivor"
#include <zp50_class_survivor>
#define LIBRARY_SNIPER "zp50_class_sniper"
#include <zp50_class_sniper>
#define LIBRARY_AMMOPACKS "zp50_ammopacks"
#include <zp50_ammopacks>
#include <csstats>

const Float:HUD_SPECT_X 0.6
const Float:HUD_SPECT_Y 0.25
const Float:HUD_STATS_X 0.0
const Float:HUD_STATS_Y 0.17

const HUD_STATS_ZOMBIE_R 200
const HUD_STATS_ZOMBIE_G 250
const HUD_STATS_ZOMBIE_B 0

const HUD_STATS_HUMAN_R 0
const HUD_STATS_HUMAN_G 200
const HUD_STATS_HUMAN_B 250

const HUD_STATS_SPEC_R 255
const HUD_STATS_SPEC_G 255
const HUD_STATS_SPEC_B 255

#define TASK_SHOWHUD 100
#define ID_SHOWHUD (taskid - TASK_SHOWHUD)

const PEV_SPEC_TARGET pev_iuser2

new g_MsgSync

public plugin_init()
{
    
register_plugin("[ZP] HUD Information"ZP_VERSION_STRING"ZP Dev Team")
    
    
g_MsgSync CreateHudSyncObj()
}

public 
plugin_natives()
{
    
set_module_filter("module_filter")
    
set_native_filter("native_filter")
}
public 
module_filter(const module[])
{
    if (
equal(moduleLIBRARY_NEMESIS) || equal(moduleLIBRARY_ASSASSIN) || equal(moduleLIBRARY_SURVIVOR) || equal(moduleLIBRARY_SNIPER) || equal(moduleLIBRARY_AMMOPACKS))
        return 
PLUGIN_HANDLED;
    
    return 
PLUGIN_CONTINUE;
}
public 
native_filter(const name[], indextrap)
{
    if (!
trap)
        return 
PLUGIN_HANDLED;
    
    return 
PLUGIN_CONTINUE;
}

public 
client_putinserver(id)
{
    if (!
is_user_bot(id))
    {
        
// Set the custom HUD display task
        
set_task(1.0"ShowHUD"id+TASK_SHOWHUD__"b")
    }
}

public 
client_disconnect(id)
{
    
remove_task(id+TASK_SHOWHUD)
}

// Show HUD Task
public ShowHUD(taskid)
{
    new 
player ID_SHOWHUD
    
    
// Player dead?
    
if (!is_user_alive(player))
    {
        
// Get spectating target
        
player pev(playerPEV_SPEC_TARGET)
        
        
// Target not alive
        
if (!is_user_alive(player))
            return;
    }
    
    
// Format classname
    
static class_name[32], transkey[64]
    new 
redgreenblue
    
    
if (zp_core_is_zombie(player)) // zombies
    
{
        
red HUD_STATS_ZOMBIE_R
        green 
HUD_STATS_ZOMBIE_G
        blue 
HUD_STATS_ZOMBIE_B
        
        
// Nemesis Class loaded?
        
if (LibraryExists(LIBRARY_NEMESISLibType_Library) && zp_class_nemesis_get(player))
            
formatex(class_namecharsmax(class_name), "%L"ID_SHOWHUD"CLASS_NEMESIS")
            
        
// Assassin Class loaded?
        
else if (LibraryExists(LIBRARY_ASSASSINLibType_Library) && zp_class_assassin_get(player))
            
formatex(class_namecharsmax(class_name), "%L"ID_SHOWHUD"CLASS_ASSASSIN")
        else
        {
            
zp_class_zombie_get_name(zp_class_zombie_get_current(player), class_namecharsmax(class_name))
            
            
// ML support for class name
            
formatex(transkeycharsmax(transkey), "ZOMBIENAME %s"class_name)
            if (
GetLangTransKey(transkey) != TransKey_Badformatex(class_namecharsmax(class_name), "%L"ID_SHOWHUDtranskey)
        }
    }
    else 
// humans
    
{
        
red HUD_STATS_HUMAN_R
        green 
HUD_STATS_HUMAN_G
        blue 
HUD_STATS_HUMAN_B
        
        
// Survivor Class loaded?
        
if (LibraryExists(LIBRARY_SURVIVORLibType_Library) && zp_class_survivor_get(player))
            
formatex(class_namecharsmax(class_name), "%L"ID_SHOWHUD"CLASS_SURVIVOR")

        
// Sniper Class loaded?
        
else if (LibraryExists(LIBRARY_SNIPERLibType_Library) && zp_class_sniper_get(player))
            
formatex(class_namecharsmax(class_name), "%L"ID_SHOWHUD"CLASS_SNIPER")
        else
        {
            
zp_class_human_get_name(zp_class_human_get_current(player), class_namecharsmax(class_name))
            
            
// ML support for class name
            
formatex(transkeycharsmax(transkey), "HUMANNAME %s"class_name)
            if (
GetLangTransKey(transkey) != TransKey_Badformatex(class_namecharsmax(class_name), "%L"ID_SHOWHUDtranskey)
        }
    }
    
    
// Spectating someone else?
    
if (player != ID_SHOWHUD)
    {
        new 
player_name[32]
        
get_user_name(playerplayer_namecharsmax(player_name))
        
        
// Show name, health, class, and money
        
set_hudmessage(255255255HUD_SPECT_XHUD_SPECT_Y16.01.10.00.0, -1)
        
        if (
LibraryExists(LIBRARY_AMMOPACKSLibType_Library))
            
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync"%L: %s^nHP: %d - %L %s - %L %d"ID_SHOWHUD"SPECTATING"player_nameget_user_health(player), ID_SHOWHUD"CLASS_CLASS"class_nameID_SHOWHUD"AMMO_PACKS1"zp_ammopacks_get(player))
        else
            
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync"%L: %s^nHP: %d - %L %s - %L $ %d"ID_SHOWHUD"SPECTATING"player_nameget_user_health(player), ID_SHOWHUD"CLASS_CLASS"class_nameID_SHOWHUD"MONEY1"cs_get_user_money(player))
    }
    else
    {
        
// Show health, class
        
set_hudmessage(red,green,blue,HUD_STATS_XHUD_STATS_Y16.01.10.00.0, -1)
        
        if (
LibraryExists(LIBRARY_AMMOPACKSLibType_Library))
            
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync"HP: %d ^n%L %s ^n%L %d"get_user_health(ID_SHOWHUD), ID_SHOWHUD"CLASS_CLASS"class_nameID_SHOWHUD"AMMO_PACKS1"zp_ammopacks_get(ID_SHOWHUD))
        else
            
ShowSyncHudMsg(ID_SHOWHUDg_MsgSync"HP: %d ^n%L %s"get_user_health(ID_SHOWHUD), ID_SHOWHUD"CLASS_CLASS"class_name)
    }

Andreita is offline
Andreita
BANNED
Join Date: Apr 2012
Old 05-02-2012 , 18:14   Re: [ZP][Help] need help to HUD
Reply With Quote #2

HELP!!! >.<
Andreita is offline
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 05-02-2012 , 22:57   Re: [ZP][Help] need help to HUD
Reply With Quote #3

Quote:
Posting

Search before a posting a question.
Use descriptive topic titles. People should know at a glance of the title what the thread is about.
Do not "bump" your threads. Bumping is posting simply to make the thread higher in the forum sort order.
Always be respectful to other members. Flaming or abusing members in any way will not be tolerated.
Do not spam, or post "me too" posts, or any such derivative drivel that does not contribute to a thread.
Do not advertise hosting services.
Do not create threads for the sole purpose of advertising a game server.
Do not post or attach illegal content, or links to illegal content, including viruses, trojans, and malware.
Do not derail threads or post completely unrelated topics in a thread.
Do not disrupt the readability of a thread with huge lengths of texts, wild color/font variations, or large images.
Also make natives in the rank xp plugin then you add them to your HUD.
__________________

Last edited by jc980; 05-02-2012 at 22:58.
jc980 is offline
Andreita
BANNED
Join Date: Apr 2012
Old 05-03-2012 , 16:35   Re: [ZP][Help] need help to HUD
Reply With Quote #4

... Aff if you doesnt how to help .. Please Dont Spam the Post..
Andreita is offline
AmineKyo
فوق سريرك
Join Date: Oct 2011
Location: Morocco
Old 05-03-2012 , 19:08   Re: [ZP][Help] need help to HUD
Reply With Quote #5

Quote:
Originally Posted by Andreita View Post
... Aff if you doesnt how to help .. Please Dont Spam the Post..
you won't get any help if you braking the rules (:
__________________
AmineKyo is offline
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 05-03-2012 , 22:37   Re: [ZP][Help] need help to HUD
Reply With Quote #6

Quote:
Originally Posted by jc980 View Post
Also make natives in the rank xp plugin then you add them to your HUD.
Did you not read what I said?

Quote:
Originally Posted by Andreita View Post
... Aff if you doesnt how to help .. Please Dont Spam the Post..
Also this is a HELP Sub-forum, NOT a request sub-forum, so you have to do it yourself what people are suggesting you to do. If it doesn't work post whats wrong.

Quote:
Originally Posted by AmineKyo View Post
you won't get any help if you braking the rules (:
This is also correct, then I would not helped you. ( Andreita )
__________________
jc980 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 13:40.


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