Raised This Month: $51 Target: $400
 12% 

Check lighting level


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 05-07-2023 , 09:29   Check lighting level
Reply With Quote #1

Hello, is there a way to check lighting level in amxx if its 0(known as "a") and 255(known as "z") etc?

Last edited by HowToRuski; 05-07-2023 at 09:31.
HowToRuski is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-08-2023 , 23:38   Re: Check lighting level
Reply With Quote #2

Are you referring to the same setting that is set by set_lights()?

Also, a to z only has 26 letters, not 255 (unless it's doing some weird interpolation in the engine).

It looks like set_lights() sets something called "light style" but I couldn't find something for reading the value.
__________________
fysiks is offline
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 05-14-2023 , 02:09   Re: Check lighting level
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
It looks like set_lights() sets something called "light style" but I couldn't find something for reading the value.
That's sad, thanks for help.

Last edited by HowToRuski; 05-14-2023 at 02:10.
HowToRuski is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 05-16-2023 , 13:40   Re: Check lighting level
Reply With Quote #4

I am not quite sure of what you want but this is the function of set_lights
Code:
 SetLights, this sets the lights for the map.
//(vexd)
static cell AMX_NATIVE_CALL set_lights(AMX *amx, cell *params) { 
	int iLength;
	char *szLights = MF_GetAmxString(amx, params[1], 0, &iLength);

	if (FStrEq(szLights, "#OFF")) {
		glinfo.bCheckLights = false;
		memset(glinfo.szLastLights, 0x0, 128);
		LIGHT_STYLE(0, glinfo.szRealLights);
		return 1;
	}
	
	glinfo.bCheckLights = true;

	//Reset LastLights and store custom lighting
	ke::SafeStrcpy(glinfo.szLastLights, sizeof(glinfo.szLastLights), szLights);

	LightStyleDetour->DisableDetour();
	LIGHT_STYLE(0, glinfo.szLastLights);
	LightStyleDetour->EnableDetour();

	// These make it so that players/weaponmodels look like whatever the lighting is
	// at. otherwise it would color players under the skybox to these values.
	SERVER_COMMAND("sv_skycolor_r 0\n");
	SERVER_COMMAND("sv_skycolor_g 0\n");
	SERVER_COMMAND("sv_skycolor_b 0\n");

	return 1;
}
You can also read this https://wiki.alliedmods.net/Half-Lif...SVC_LIGHTSTYLE
__________________
Jhob94 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 12:04.


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