Raised This Month: $ Target: $400
 0% 

Set map lights to dark?


Post New Thread Reply   
 
Thread Tools Display Modes
proffs
Senior Member
Join Date: Jul 2013
Old 03-28-2016 , 20:47   Re: Set map lights to dark?
Reply With Quote #11

Quote:
Originally Posted by th7nder View Post
just do it in OnMapStart()
But I don't want it in on Mapstart only specefic times.
__________________
proffs is offline
thecount
Veteran Member
Join Date: Jul 2013
Old 03-28-2016 , 23:14   Re: Set map lights to dark?
Reply With Quote #12

Quote:
Originally Posted by proffs View Post
I did according to the API but it won't turn off the lights, I looped through all players and set the lights to B but it didn't do anything
You looped through players to set lights?
thecount is offline
hu3br
Senior Member
Join Date: Apr 2015
Old 03-29-2016 , 11:40   Re: Set map lights to dark?
Reply With Quote #13

new FogIndex = -1;
new Float:mapFogStart = 0.0;
new Float:mapFogEnd = 150.0;
new Float:mapFogDensity = 0.99;

public OnMapStart()
{
new ent;
ent = FindEntityByClassname(-1, "env_fog_controller");
if (ent != -1)
{
FogIndex = ent;
}
else
{
FogIndex = CreateEntityByName("env_fog_controller");
DispatchSpawn(FogIndex);
}
Fog();
AcceptEntityInput(FogIndex, "TurnOff");
}

Public action(....)
{
AcceptEntityInput(FogIndex, "TurnOn");
PrintToChat("Dark On")
}
Fog()
{
if(FogIndex != -1)
{
DispatchKeyValue(FogIndex, "fogblend", "0");
DispatchKeyValue(FogIndex, "fogcolor", "0 0 0");
DispatchKeyValue(FogIndex, "fogcolor2", "0 0 0");
DispatchKeyValueFloat(FogIndex, "fogstart", mapFogStart);
DispatchKeyValueFloat(FogIndex, "fogend", mapFogEnd);
DispatchKeyValueFloat(FogIndex, "fogmaxdensity", mapFogDensity);
}
}
hu3br is offline
proffs
Senior Member
Join Date: Jul 2013
Old 03-30-2016 , 16:02   Re: Set map lights to dark?
Reply With Quote #14

Quote:
Originally Posted by thecount View Post
You looped through players to set lights?
Even if I don't loop through all players it won't work for me.
__________________
proffs is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 03-31-2016 , 03:18   Re: Set map lights to dark?
Reply With Quote #15

Quote:
Originally Posted by proffs View Post
Even if I don't loop through all players it won't work for me.
SetLightStyle has bug, it doesn't do effects on players already on the server only reconnect or map restart. It's bacuase of client side won't update during the server
Despirator is offline
proffs
Senior Member
Join Date: Jul 2013
Old 03-31-2016 , 08:01   Re: Set map lights to dark?
Reply With Quote #16

Quote:
Originally Posted by Despirator View Post
SetLightStyle has bug, it doesn't do effects on players already on the server only reconnect or map restart. It's bacuase of client side won't update during the server
What should I do then?
Is there anyway around this or to make the map dark with some other thing?
__________________
proffs is offline
thecount
Veteran Member
Join Date: Jul 2013
Old 03-31-2016 , 10:26   Re: Set map lights to dark?
Reply With Quote #17

I'm pretty sure you can loop through all the lights and change their intensity/color instead of style. I know it is possible to create lights and change them, so it should be possible to simply change existing ones.
PHP Code:
new ent = -1;
while((
ent=FindEntityByClassname(ent"light"))!= -1){
    
DispatchKeyValue(ent"Brightness""255 255 255 1");//Last number is brightness, the rest is color


Last edited by thecount; 03-31-2016 at 10:33.
thecount is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 03-31-2016 , 10:49   Re: Set map lights to dark?
Reply With Quote #18

I don't think you can loop thru "light" entities... As far as I know, these entities are destroyed on map compilation. Changing map lighting "on fly" only causes many visual glitches, especially in CS:GO...

I guess the best possible way here would be to create black fog, but it's a fog and not shadow...
__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline
Proz
AlliedModders Donor
Join Date: Apr 2005
Old 04-01-2016 , 12:50   Re: Set map lights to dark?
Reply With Quote #19

Is there a way to do the opposite? Make the lights brighter or add a new light source on a map with a plugin?
Proz is offline
thecount
Veteran Member
Join Date: Jul 2013
Old 04-01-2016 , 14:42   Re: Set map lights to dark?
Reply With Quote #20

You can add a new light with CreateEntityByName("light");
thecount 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 02:32.


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