AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   creating lightmap plugin (https://forums.alliedmods.net/showthread.php?t=72479)

Alucard^ 06-08-2008 22:10

creating lightmap plugin
 
hi guys, here i decide to learn scripting in amxx, i am REALLY new on this

i try to create a lightmap plugin, something like this http://forums.alliedmods.net/showthread.php?p=32508

is a easy plugin (but not for me haha)

i can write only this without see the code of the amx_lights plugin... =(

PHP Code:

/* Script generated by Pawn Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN    "light map"
#define AUTHOR    "Alucard"
#define VERSION    "1.0"

#define    FCVAR_SERVER

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_concmd("nv_lightmap""set_lights"ADMIN_SLAY"<a-z> ")
}

public 
set_lights(idlevelcid)
{
       if (!
cmd_access(idlevelcid2))
           return 
PLUGIN_HANDLED
    
    
return PLUGIN_HANDLED    


yea i know, this is only a part of the plugin, but, THIS PART.. is correct? , if is not, why not?

and, what i need to finish the plugin...

thx

pd: sry for my bad english

v3x 06-09-2008 02:25

Re: creating lightmap plugin
 
Yup. That's correct.

PHP Code:

/* Script generated by Pawn Studio */

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

#define PLUGIN    "light map"
#define AUTHOR    "Alucard"
#define VERSION    "1.0"

#define fm_set_lights(%1) engfunc(EngFunc_LightStyle, 0, "%1")

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_concmd("nv_lightmap""set_lights"ADMIN_SLAY"<a-z> ")
}

public 
set_lights(idlevelcid)
{
    if (!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED

    
new style[4]
    
read_argv(1style3)

    
fm_set_lights(style)
    
    return 
PLUGIN_HANDLED    



Alucard^ 06-09-2008 03:03

Re: creating lightmap plugin
 
oh, really thx v3x,

i dont understand 2 parts of this code:

1 - can u explain me what happen in this part? i think this is to put the default set_lights? or something like this?
PHP Code:

#define fm_set_lights(%1) engfunc(EngFunc_LightStyle, 0, "%1") 

2- i have mistakes on this... yea, u crate a "new style", but, why the string are [4]? why not 5? what mean this strings and what mean style (style of what? of light?)?

PHP Code:

    new style[4]
    
read_argv(1style3)

    
fm_set_lights(style

thx a lot of v3x

v3x 06-09-2008 03:13

Re: creating lightmap plugin
 
1. Nobody uses Engine anymore. It's all about FakeMeta, baby 8)
2. You can make it as long as you want. That was just an example. Oh and yes, it's the style of the light.

~v3x

Alucard^ 06-09-2008 04:16

Re: creating lightmap plugin
 
1. aa ok , but i did search with fm_set_lights and i didnt find nothing, i think becouse use the some function but with fm_ , right?
and.. what u recommend me to learn more about fakemeta?

2. yeah, now i understand the code of this, but that i dont understand are the styles, what styles of lights? becouse, i think when u call set_lights, this function have A to Z (a-z) , or u have to create this? (that in this case are the "styles")

thx

PD: oh, other question, the "style" is an example too? or is a some function or something like this?

edit: oh, here i have some help to learn fakemeta http://www.amxmodx.org/funcwiki.php?go=module&id=16
but if u have another good link, great too =p

atomen 06-09-2008 04:35

Re: creating lightmap plugin
 
I got one question, this has been asked here
Quote:

engfunc(EngFunc_LightStyle, <thisthing>, flags)
What does "<thisthing>" do ?

Alucard^ 06-09-2008 06:35

Re: creating lightmap plugin
 
with this:

PHP Code:

/* Script generated by Pawn Studio */

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

#define PLUGIN    "light map"
#define AUTHOR    "Alucard"
#define VERSION    "1.0"

#define fm_set_lights(%1) engfunc(EngFunc_LightStyle, 0, "%1")

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_concmd("nv_lightmap""set_lights"ADMIN_SLAY"<a-z> ")
}

public 
set_lights(idlevelcid)
{
    if (!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLED

    
new style[4]
    
read_argv(1style3)

    
fm_set_lights(style)
    
    return 
PLUGIN_HANDLED    


if i put nv_lightmap 0 for example, the map get light, and if i put nv_lightmap 10, or something like this, not change nothing... and i try to put A-Z but, nothing, i cant put off the lightsmap, and i cant change the value...

what is the code to do that?

v3x 06-09-2008 14:36

Re: creating lightmap plugin
 
Add a debug message. After fm_set_lights(style) put this:

PHP Code:

client_print(idprint_chat"Lights style: %s"style); 

Let me know what it says, if anything.

Alucard^ 06-12-2008 10:59

Re: creating lightmap plugin
 
sry, i am back ...

@ v3x

when i put for example, nv_lightmap a

i get this:
Quote:

Lights style: a
when i put z:

Quote:

Lights style: z
etc..

but, a, or b, or c, d, e, f, ......... dont change the light of the map... and i cant put off...


All times are GMT -4. The time now is 06:53.

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