AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   allow display hud/dhus messages in hideweapon event (https://forums.alliedmods.net/showthread.php?t=228784)

faggetpls 10-26-2013 23:15

allow display hud/dhus messages in hideweapon event
 
^title (while i remove hud it should allow display hud/dhud), also which one method is better, commented one or should i use default taken from connors plugin?

PHP Code:

#include <amxmodx> 
#include <fakemeta>
#include <hamsandwich>

#define    offset_hide_hud                361
#define    offset_client_hide_hud            362
#define    offset_client_active_item        374
#define HideWeapon                94    // get_user_msgid("HideWeapon")

new bool:enabled[33] = false

public plugin_init() { 
    
//register_plugin("HUD Customizer", "0.6", "Igoreso/ConnorMcLeod") 
    
register_clcmd("say test""x")
}

public 
client_disconnect(idenabled[id] = false

public x(id) {
    if (
enabled[id] == false) {
        
enabled[id] = true
        
// Don't know use of it
        //set_pdata_int(id, offset_client_hide_hud, 0)
        // Removes hud
        
set_pdata_int(idoffset_hide_hud4)
        
        
        
//message_begin(MSG_ONE_UNRELIABLE, HideWeapon, _, id) 
        //write_byte(4)
        //message_end()
    
}
    
    else {
        
enabled[id] = false
        
// Don't know use of it
        //set_pdata_int(id, offset_client_hide_hud, 1)
        // Shows hud
        
set_pdata_int(idoffset_hide_hud0)
        
// Removes ugly spectator crosshair
        
set_pdata_cbase(idoffset_client_active_itemFM_NULLENT)
        
        
        
        
//message_begin(MSG_ONE_UNRELIABLE, HideWeapon, _, id)
        //write_byte(0)
        //message_end()
    
}



lein 10-27-2013 14:08

Re: allow display hud/dhus messages in hideweapon event
 
Sure,using fakemeta module is more high-efficiency!
And you can search the example.


All times are GMT -4. The time now is 23:13.

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