Raised This Month: $ Target: $400
 0% 

Light level


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-27-2005 , 22:55   Light level
Reply With Quote #1

( Damn I'm posting a lot of topics in here lately )

I'm trying to make the player's footsteps silent in darker areas and in the opposite in lighter areas. Here's what I came up with but it gives the player silent footsteps 24/7:
Code:
    if(entity_get_int(id,EV_INT_light_level) <= LIGHT_LEVEL) {     set_user_footsteps(id,1); } else {     set_user_footsteps(id,0); }
I have LIGHT_LEVEL set to 25 atm.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 08-27-2005 , 23:05  
Reply With Quote #2

its most likely just checking the whole map instead of that specifix area...so both become true and since the last if statements makes it where nobody has foot steps...


you need to get the origin of the light and light areas somehow and then contrast it with the player origin...


hope this help ;)
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-27-2005 , 23:27  
Reply With Quote #3

No, I've already tested it:
Code:
#include <amxmodx> #include <engine> public plugin_init() {     register_plugin("Light Test","0.1","v3x")     register_clcmd("lights","ClCmd_Lights",0) } public ClCmd_Lights(id) {     client_print(id,print_chat,"Light level: %i",entity_get_int(id,EV_INT_light_level))     return PLUGIN_HANDLED }
Please don't reply to anything else I've started in Scripting Help, Zenith.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-27-2005 , 23:53  
Reply With Quote #4

How is this check ran?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-28-2005 , 00:09  
Reply With Quote #5

PreThink.. Not sure if that's the best way..
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 08-28-2005 , 00:52  
Reply With Quote #6

Try testing in prethink by showing the light levels to see if it would effect server play.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 08-28-2005 , 01:08  
Reply With Quote #7

vex what does it print out in dark areas as to light areas?
Freecode is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-28-2005 , 01:10  
Reply With Quote #8

Quote:
Originally Posted by Freecode
vex what does it print out in dark areas as to light areas?
Well, in the tunnel in dust1 it's usually around 25 or less in the darker areas. I forget what it is in the lighter areas..
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 08-28-2005 , 02:05  
Reply With Quote #9

also whats LIGHT_LEVEL defined as?
Code:
if(entity_get_int(id,EV_INT_light_level) <= LIGHT_LEVEL)
should it be =>
Freecode is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-28-2005 , 02:17  
Reply With Quote #10

As I said before, LIGHT_LEVEL is defined as 25 .

Do you want me to change it to =>?

Low light = no footsteps
High light = footsteps
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:29.


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