Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2012-10-24 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
October 24, 2012, 03:21:46 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://war3source.com/index.php?board=9.0
What is War3Source?: http://war3source.com/index.php?topic=200.0
Sample Stats: http://war3source.com/war3stats
Steam Community Group: http://steamcommunity.com/groups/war3source
War3Source SVN Checkout: http://ownageclan.com/svn/war3source/
War3Source servers: http://www.game-monitor.com/search.php?vars=war3_version=
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: NightVision  (Read 251 times)
M.A.C.A.B.R.A
Newbie
*
Posts: 20



View Profile WWW
« on: December 05, 2011, 03:01:07 AM »

Hi. I tried to code a skill which activates when a player is using nightvision. The only problem is there is no nvision event in CSS. I thought about using FakeClientCommands but I'm not sure it would work correctly.  Is there a better way to do this?
Logged

Vulpone
Full Member
***
Posts: 140



View Profile Email
« Reply #1 on: December 05, 2011, 05:32:24 AM »

Hi. I tried to code a skill which activates when a player is using nightvision. The only problem is there is no nvision event in CSS. I thought about using FakeClientCommands but I'm not sure it would work correctly.  Is there a better way to do this?

On
Quote
SetEntProp(client, Prop_Send, "m_bHasNightVision", 1, 1)

Off
Quote
SetEntProp(client, Prop_Send, "m_bHasNightVision", 0, 1)
Logged

Sapere aude!
Necavi
Full Member
***
Posts: 223


View Profile
« Reply #2 on: December 05, 2011, 05:40:16 AM »

Should be able to use some sort of hook, similar to IN_JUMP to figure out when they go into nightvision (vulpone merely suggested how to set nightvision).
Logged

Vulpone
Full Member
***
Posts: 140



View Profile Email
« Reply #3 on: December 05, 2011, 05:52:12 AM »

Should be able to use some sort of hook, similar to IN_JUMP to figure out when they go into nightvision (vulpone merely suggested how to set nightvision).

Oh, I just realized I misread his request.

My bad.

Edit:

Of course, the inelegant way of handling this would be a timer.
I could not find anything regarding this topic on Google (or rather, AlliedModders), so I know no way around it.

Or just do a while loop.
« Last Edit: December 05, 2011, 05:54:48 AM by Vulpone » Logged

Sapere aude!
Necavi
Full Member
***
Posts: 223


View Profile
« Reply #4 on: December 05, 2011, 05:58:24 AM »

I know its possible using SDKHooks, but will likely be just as easy without it, it'll just require some more research, maybe a post on AlliedMods
Logged

M.A.C.A.B.R.A
Newbie
*
Posts: 20



View Profile WWW
« Reply #5 on: December 05, 2011, 06:51:46 AM »

I will try to use that commands. Thanks.
Logged

Glider⠠⠵
Global Moderator
Sr. Member
*****
Posts: 413


⠠⠵


View Profile
« Reply #6 on: December 05, 2011, 08:20:52 AM »

You could hook something like OnGameFrame, OnPlayerRunCmd or just hook the think action with SDK Hooks and check for it repeatedly.
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!