AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   block nvg buying (https://forums.alliedmods.net/showthread.php?t=13392)

n0obie4life 05-15-2005 03:23

block nvg buying
 
i tried this code

Code:
 public cmdnvgblock()  {      if (get_cvar_num ("dark_allownvg") == 0 )           return PLUGIN_CONTINUE            return PLUGIN_HANDLED  }

the registered command is this:
Code:
    register_clcmd("nvgs", "cmdnvgblock")

somehow, it doesn't work. any idea?

sambro 05-15-2005 05:27

Try just hooking the NVGToggle event.

If they turn their NVG on, turn it back off automatically.

Code:
 register_event("NVGToggle", "blockNVG", "1=1");

The 1=1 flag means the blockNVG function will only get called if the user turned their NVG on. If you did 1=2, then it would get called when NVG got turned off, which is useless in this case :)

n0obie4life 05-16-2005 09:31

nope doesn't work.


All times are GMT -4. The time now is 16:41.

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