Raised This Month: $56 Target: $400
 14% 

creating lightmap plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-08-2008 , 23:10   creating lightmap plugin
Reply With Quote #1

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

Last edited by Alucard^; 06-08-2008 at 23:15.
Alucard^ is offline
Send a message via Skype™ to Alucard^
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-09-2008 , 03:25   Re: creating lightmap plugin
Reply With Quote #2

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    

__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-09-2008 , 04:03   Re: creating lightmap plugin
Reply With Quote #3

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
Alucard^ is offline
Send a message via Skype™ to Alucard^
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-09-2008 , 04:13   Re: creating lightmap plugin
Reply With Quote #4

1. Nobody uses Engine anymore. It's all about FakeMeta, baby
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
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-09-2008 , 05:16   Re: creating lightmap plugin
Reply With Quote #5

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

Last edited by Alucard^; 06-09-2008 at 05:36.
Alucard^ is offline
Send a message via Skype™ to Alucard^
atomen
Veteran Member
Join Date: Oct 2006
Location: Stockholm, Sweden
Old 06-09-2008 , 05:35   Re: creating lightmap plugin
Reply With Quote #6

I got one question, this has been asked here
Quote:
engfunc(EngFunc_LightStyle, <thisthing>, flags)
What does "<thisthing>" do ?
__________________
atomen is offline
Send a message via MSN to atomen
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-09-2008 , 07:35   Re: creating lightmap plugin
Reply With Quote #7

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?
Alucard^ is offline
Send a message via Skype™ to Alucard^
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-09-2008 , 15:36   Re: creating lightmap plugin
Reply With Quote #8

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.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-12-2008 , 11:59   Re: creating lightmap plugin
Reply With Quote #9

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...
Alucard^ is offline
Send a message via Skype™ to Alucard^
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 08:39.


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