Raised This Month: $ Target: $400
 0% 

Disable Huds From Plugins


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 07-13-2020 , 06:31   Re: Disable Huds From Plugins
Reply With Quote #4

Quote:
Originally Posted by chickez View Post
PHP Code:
// Toggle Showing Hud Message On / Off
public cmdToggleHudid ) {
    
g_bToggleHudid ] = !g_bToggleHudid ];
    return 
PLUGIN_HANDLED;

It will set bool to false one time. When player want back to turn on HUD, he must reconnect ( set bool to true ). I'm right?

I haven't test script but, why not like this?:
PHP Code:
// Toggle Showing Hud Message On / Off
public cmdToggleHudid )
{
    if ( 
g_bToggleHudid ] )
        
g_bToggleHudid ] = false;
    else
        
g_bToggleHudid ] = true;
    return 
PLUGIN_HANDLED;

I'm just asking, if I'm right.

I have hud on/off in my plugin coded like I post, and it's working for me.

No, he can do it automatically so if he said /hud, hudessage will disable automatic and if said /hud again will enable the hud message
Supremache is offline
 



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:50.


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