Like this. This was originally demonstrated to me by AssKicr, and it seems to be directed towards making your own nvg implementation.
You may want to emit_sound emit_sound "items/nvg_on.wav" or "items/nvg_off.wav" and keep track of the states being used. You could do this by creating a "pvGoggles[32]" and "pvHasGoggles[32]" variable to store information about whether players can use it or not.
Code:
message_begin(MSG_ONE, get_user_msgid("NVGToggle"), {0,0,0}, id)
write_byte(state) //1=on 0=off
message_end()
__________________