ItsMods
[Release] HUD Toggler - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: [Release] HUD Toggler (/Thread-Release-HUD-Toggler.html)



HUD Toggler - Nekochan - 02-03-2012

Hey guys,

i made new plugin, which switches hud on !hud command without 0 or 1.

Source code:
Code:
using Addon; using System.Collections.Generic; namespace plugin_test { public class plugin_test : CPlugin { public bool hud_enabled = true; public override void OnServerLoad() { ServerPrint("\n Hud Switcher plugin loaded. \n Creator: x7'se7en"); } public override ChatType OnSay(string Message, ServerClient Client) { if (Message.StartsWith("!hud")) { if (hud_enabled) { SetClientDvar(Client.ClientNum, "g_hardcore \"0\""); TellClient(Client.ClientNum, "^3HUD Disabled.", true); disable2(); } else { SetClientDvar(Client.ClientNum, "g_hardcore \"1\""); TellClient(Client.ClientNum, "^3HUD Enabled.", true); enable2(); } } return ChatType.ChatContinue; } public void disable2() { hud_enabled = false; } public void enable2() { hud_enabled = true; } } }

Someone test it.

Download:

.rar   hudpluh.rar (Size: 1.94 KB / Downloads: 127)


RE: HUD Toggler - crAyon - 02-03-2012

......................



RE: HUD Toggler - zxz0O0 - 02-03-2012

That's not going to work. See you are setting a global variable (variable for everyone) for a client. That means when someone disables hud, the plugin means everyone disabled hud. You need to do it someway different where you for example a Dictionary with client xuid and hud bool.

But good idea. [Image: in.gif] <-- @SuperNovaAO add that smiley


RE: HUD Toggler - Pozzuh - 02-03-2012

(02-03-2012, 20:15)zxz0O0 Wrote: That's not going to work. See you are setting a global variable (variable for everyone) for a client. That means when someone disables hud, the plugin means everyone disabled hud. You need to do it someway different where you for example a Dictionary with client xuid and hud bool.

But good idea. [Image: in.gif] <-- @SuperNova add that smiley

It was close enough actually. The client dvar that enables / disables the hud is "ui_hud_hardcore".




RE: HUD Toggler - pollarpart - 02-29-2012

doesn't work...


RE: HUD Toggler - surtek - 02-29-2012

(02-29-2012, 02:31)pollarpart Wrote: doesn't work...

You can help the TS by being more specific.


RE: HUD Toggler - Pozzuh - 02-29-2012

(02-29-2012, 16:24)surtek Wrote:
(02-29-2012, 02:31)pollarpart Wrote: doesn't work...

You can help the TS by being more specific.

There is nothing to be specific about. It just doesn't work. The hud doesn't get disabled because se7en used the wrong dvar.


RE: HUD Toggler - pollarpart - 03-01-2012

(02-29-2012, 16:25)Pozzuh Wrote:
(02-29-2012, 16:24)surtek Wrote:
(02-29-2012, 02:31)pollarpart Wrote: doesn't work...

You can help the TS by being more specific.

There is nothing to be specific about. It just doesn't work. The hud doesn't get disabled because se7en used the wrong dvar.
Pozzuh, fix please? Big Grin

PLEASE POZZUH lol