Raised This Month: $222 Target: $400
 55% 

light from map


Post New Thread Reply   
 
Thread Tools Display Modes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-29-2010 , 15:50   Re: light from map
Reply With Quote #11

Search for plugin with command amx_lights.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-30-2010 , 01:54   Re: light from map
Reply With Quote #12

Quote:
Originally Posted by rrduna View Post
is there any way to start the plugin with the cmd amx_set_light already established a level of light?
Put in amxx.cfg :

amx_set_light "d" // example
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 11-30-2010 , 02:24   Re: light from map
Reply With Quote #13

Quote:
Originally Posted by ConnorMcLeod View Post
I'm using this on my kz server, on very dark maps you can use 'A' that is kind of fullbright.
If you want to save the actual light for next time the map is loaded, do amx_save_light.
Haven't tried is set_lights support 'A' argument, if so it could be better to use it instead of convertion, even if my plugin sends LightStyle at right place (when a user enter the server) when engine sends it every seconds.
Also my convertion doesn't change sv_skycolor_* cvars, you may need them to be changed.

PHP Code:
/*    Formatright  2010, ConnorMcLeod

    This plugin is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this plugin; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define VERSION "0.0.1"
#define PLUGIN "Change Light"

#define LIGHT_STYLE(%0,%1) engfunc(EngFunc_LightStyle, %0, %1)

new g_szCurrentLight[2]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
register_concmd("amx_set_light""set_light"ADMIN_CFG"<a-z>")
    
register_concmd("amx_save_light""save_light"ADMIN_CFG"Saves current light in map .cfg file")
}

public 
plugin_precache()
{
    
register_forward(FM_LightStyle"LightStyle"1)
}

public 
LightStyle(iStyleszPattern[])
{
    if( !
iStyle )
    {
        
g_szCurrentLight[0] = szPattern[0]
    }
}

public 
set_lightidlvlcmd )
{
    if( 
cmd_access(idlvlcmd1) )
    {
        if( 
read_argc() == )
        {
            
read_argv(1g_szCurrentLightcharsmax(g_szCurrentLight))
            
LIGHT_STYLE(0g_szCurrentLight)
        }
        else if( 
g_szCurrentLight[0] )
        {
            
console_print(id"Current Light is %d (%c)"g_szCurrentLight[0] - 'a'g_szCurrentLight[0])
        }
        else
        {
            
console_print(id"No light is actually set oO !!")
        }
    }
    return 
PLUGIN_HANDLED
}

public 
save_lightidlvlcmd )
{
    if( 
cmd_access(idlvlcmd1) )
    {
        new 
szConfigFile[128], szMapName[32]
        
get_configsdir(szConfigFilecharsmax(szConfigFile))
        
get_mapname(szMapNamecharsmax(szMapName))
        
add(szConfigFilecharsmax(szConfigFile), "/maps")
        if( !
dir_exists(szConfigFile) )
        {
            
mkdir(szConfigFile)
        }
        
format(szConfigFilecharsmax(szConfigFile), "%s/%s.cfg"szConfigFileszMapName)
        new 
fp fopen(szConfigFile"at")
        
fprintf(fp"^namx_set_light %s^n"g_szCurrentLight)
        
fclose(fp)
    }
    return 
PLUGIN_HANDLED
}

public 
client_putinserverid )
{
    
LIGHT_STYLE(0g_szCurrentLight)

What does the second parameter of EngFunc_LightStyle do ??
engfunc(EngFunc_LightStyle, this_paramter, "")
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-30-2010 , 06:14   Re: light from map
Reply With Quote #14

The first is a predefined style. 13 by default. Though it's possible to setup up to 32.
The second is you want to make your own patter. So 0, as style.

As side-note, styles 32 to 62 are assigned by the light program for switchable lights, which means each light uses an unique number >= 32 to be identified as style, then use either "a" to be off either "z" to be on or either a custom one, as pattern.
__________________
Arkshine is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 11-30-2010 , 07:48   Re: light from map
Reply With Quote #15

Quote:
Originally Posted by Arkshine View Post
The first is a predefined style. 13 by default. Though it's possible to setup up to 32.
The second is you want to make your own patter. So 0, as style.

As side-note, styles 32 to 62 are assigned by the light program for switchable lights, which means each light uses an unique number >= 32 to be identified as style, then use either "a" to be off either "z" to be on or either a custom one, as pattern.
Can u be more descriptive and give an example coz i wasnt able to understand a word
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
rrduna
Member
Join Date: Nov 2010
Location: Brazil
Old 11-30-2010 , 17:58   Re: light from map
Reply With Quote #16

have any way to leave it like that?
and also add a cvar to set the brightness from the beginning of the map.
Example: amx_set_light c

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta> 

#define VERSION "0.0.1" 
#define PLUGIN "Change Light" 

#define LIGHT_STYLE(%0,%1) engfunc(EngFunc_LightStyle, %0, %1) 

new g_szCurrentLight[2

public 
plugin_init() { 
        
register_plugin(PLUGINVERSION"ConnorMcLeod"
        
register_concmd("amx_set_light""set_light"ADMIN_CFG"<a-z>"


public 
plugin_precache() { 
        
register_forward(FM_LightStyle"LightStyle"1


public 
LightStyle(iStyleszPattern[]) { 
        if( !
iStyle 
        { 
        
g_szCurrentLight[0] = szPattern[0
        } 


public 
set_lightidlvlcmd ) { 
        if( 
cmd_access(idlvlcmd1) ) 
        { 
        if( 
read_argc() == 
        { 
            
read_argv(1g_szCurrentLightcharsmax(g_szCurrentLight)) 
            
LIGHT_STYLE(0g_szCurrentLight
        } 
        else if( 
g_szCurrentLight[0] ) 
        { 
            
console_print(id"Current Light is %d (%c)"g_szCurrentLight[0] - 'a'g_szCurrentLight[0]) 
        } 
        else 
        { 
            
console_print(id"No light is actually set oO !!"
        } 
        } 
        return 
PLUGIN_HANDLED 

rrduna is offline
Reply


Thread Tools
Display Modes

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 15:07.


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