PHP Code:
// Toggle Showing Hud Message On / Off
public cmdToggleHud( id ) {
g_bToggleHud[ id ] = !g_bToggleHud[ id ];
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 cmdToggleHud( id )
{
if ( g_bToggleHud[ id ] )
g_bToggleHud[ id ] = false;
else
g_bToggleHud[ id ] = 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.