The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 786 - File: showthread.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/showthread.php 786 errorHandler->error






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to turn all light sources ON/OFF
Author Message
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #1
How to turn all light sources ON/OFF
Hey guys, I need another idea...
I'm trying to turn all light sources on and off, but I think the only way to turn on/off is dclicking (DCLICK) it or using (USE)...

So I made this code, should works fine but sometimes it don't turn on all types I set to do.

PHP Code:
[DEFNAME LIGHTTYPES]
LIGHT.1 I_TORCH_WALL
LIGHT.2 I_TORCH_WALL2
LIGHT.3 I_CANDELABRA
LIGHT.4 I_CANDELABRA2

[FUNCTION TURNLIGHTS]
SERV.NEWNPC C_ZOMBIE
REF1 
<NEW>
REF1.FLAGS STATF_INVISIBLE
FOR I 1 4
 serv
.<DEF.LIGHT.<dLOCAL.I>><QVAL <ARGS>==1?:_LIT>
 
FORINSTANCES <DEF.LIGHT.<dLOCAL.I>><QVAL <ARGS>==1?:_LIT>
  IF !<
CONT>
   
REF1.<P>
   
MOREY 20
   REF1
.DCLICK <UID>
  ENDIF
 ENDFOR
ENDFOR
REF1.REMOVE
RETURN 

How to use: .turnlights 0 to turn all lights off, or 1 to turn on.

Any idea how to improve it?

Thanks

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
06-23-2013 02:38 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
How to turn all light sources ON/OFF - Extreme - 06-23-2013 02:38 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)