Hello. Could anyone help me with a fakemeta version of set_lights ? (EngFunc_LightStyle)
I know I could just do engfunc(EngFunc_LightStyle, 0, "value") where value would be a letter from a to z and then execute the 3 server commands.
Problem is that I want to also be able to reset lights to default value by using #OFF as the value just like it works with engine.
Original C++ code from engine.cpp
PHP Code:
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;
}
Thanks !