Raised This Month: $ Target: $400
 0% 

Using the plugin with variables


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-12-2011 , 12:29   Re: Using the plugin with variables
Reply With Quote #2

To make this per-player specific settings you only need one array with a dimension of 33 (each player would have their own g_bitHudFlags)

Something like this:

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

#define VERSION "0.6" 

const HUD_HIDE_CAL 1<<0
const HUD_HIDE_FLASH 1<<1
const HUD_HIDE_ALL 1<<2    
const HUD_HIDE_RHA 1<<3
const HUD_HIDE_TIMER 1<<4
const HUD_HIDE_MONEY 1<<5
const HUD_HIDE_CROSS 1<<6
const HUD_DRAW_CROSS 1<<7

const HIDE_GENERATE_CROSSHAIR HUD_HIDE_FLASH|HUD_HIDE_RHA|HUD_HIDE_TIMER|HUD_HIDE_MONEY|HUD_DRAW_CROSS

#define    m_iHideHUD            361
#define    m_iClientHideHUD        362
#define    m_pClientActiveItem        374

new g_bitHudFlags[33]

public 
plugin_init() 

    
register_plugin("HUD Customizer"VERSION"Igoreso/ConnorMcLeod"
    
    
register_event("ResetHUD""Event_ResetHUD""b")
    
register_event("HideWeapon""Event_HideWeapon""b")
}

public 
Event_ResetHUD(id)
{
    if( 
g_bitHudFlags[id] )
    {
        
set_pdata_int(idm_iClientHideHUD0)
        
set_pdata_int(idm_iHideHUDg_bitHudFlags[id])
    }    
}

public 
Event_HideWeaponid )
{
    new 
iFlags read_data(1)
    if( 
g_bitHudFlags[id] && (iFlags g_bitHudFlags[id] != g_bitHudFlags[id]) )
    {
        
set_pdata_int(idm_iClientHideHUD0)
        
set_pdata_int(idm_iHideHUDiFlags|g_bitHudFlags[id])
    }

    if( 
iFlags HIDE_GENERATE_CROSSHAIR && !(g_bitHudFlags[id] & HUD_DRAW_CROSS) && is_user_alive(id) )
    {
        
set_pdata_cbase(idm_pClientActiveItemFM_NULLENT)
    }

__________________
fysiks is online now
 



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 23:27.


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