Thread: [Solved] Help with turn on / off hud
View Single Post
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 11-04-2020 , 14:07   Re: Help with turn on / off hud
Reply With Quote #2

Try this:
Code:
#include <amxmodx> new g_ShowHud[ 33 ] = true; public plugin_init() {     register_clcmd( "say /hud", "cmdShowHud" ); } // Toggle Showing Hud Message On / Off public cmdShowHud( id ) {     g_ShowHud[ id ] = !g_ShowHud[ id ];     return PLUGIN_HANDLED; } public client_putinserver( id ) {     g_ShowHud[ id ] = true;     set_task( 0.9, "ShowHud", id, _, _, "b" ); } public ShowHud( id ) {     if( g_ShowHud[ id ] ) {                 new szServerIP[ 64 ], szHostName[ 64 ]         get_user_ip(0, szServerIP, charsmax(szServerIP))         get_cvar_string("hostname", szHostName, charsmax(szHostName))             set_hudmessage(6, 70, 199, 0.0, 0.21, 0, 6.0, 1.1)         show_hudmessage(0, "Server: %s^nIP: %s", szHostName, szServerIP);     } }
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline