Raised This Month: $32 Target: $400
 8% 

Light Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-24-2017 , 02:30   Light Problem
Reply With Quote #1

Hello. I have a poblem on my mapm I can't spawn the light.
Someone told me that u can't sawn lights, but I am not sure.
Any help would be appreciated !
Thanks !

Code:
    new ent_light_1 = create_entity("light");
    DispatchSpawn(ent_light_1);
    DispatchKeyValue(ent_light_1, "style", "0");
    DispatchKeyValue(ent_light_1, "_light", "241.0,241.0,241.0,150.0");
    entity_set_origin(ent_light_1,Float:{-433.0,952.0,-165.0});
    entity_set_string(ent_light_1,EV_SZ_classname,"light");
    entity_set_string(ent_light_1,EV_SZ_targetname,"light_render");
    entity_set_string(ent_light_1,EV_INT_flags, "0");{241.0,241.0,241.0});
DarthMan is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 02-24-2017 , 03:46   Re: Light Problem
Reply With Quote #2

Hi
You want spawn the light in some texteure in the map ?
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-24-2017 , 03:50   Re: Light Problem
Reply With Quote #3

Quote:
Originally Posted by abdobiskra View Post
Hi
You want spawn the light in some texteure in the map ?
I mean spawn it at a given position, but ye, it would be cool if you could make it spawn 44 lights, for each entity by target name glass_votemap , a light on center top of the window entity. Each light should have the targetname set to light_render.
DarthMan is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 02-24-2017 , 08:35   Re: Light Problem
Reply With Quote #4

I was looking for the components i have made in the past but lost
but as i remember its like this :
PHP Code:
public create_light(origin[3])
{
    
    
origin[0] = 5origin[1] = -2224origin[2] = -1803

    message_begin
(MSG_BROADCAST,SVC_TEMPENTITY);
    
write_byte(TE_DLIGHT);
    
write_coord(origin[0]);
    
write_coord(origin[1]);
    
write_coord(origin[2]);
    
write_byte(30);//R 
    
write_byte(255);//r
    
write_byte(0);//g 
    
write_byte(0);//b 
    
write_byte(60);//t 
    
write_byte(20);//decay *0.1s
    
message_end();

__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-24-2017 , 08:38   Re: Light Problem
Reply With Quote #5

Quote:
Originally Posted by abdobiskra View Post
I was looking for the components i have made in the past but lost
but as i remember its like this :
PHP Code:
public create_light(origin[3])
{
    
    
origin[0] = 5origin[1] = -2224origin[2] = -1803

    message_begin
(MSG_BROADCAST,SVC_TEMPENTITY);
    
write_byte(TE_DLIGHT);
    
write_coord(origin[0]);
    
write_coord(origin[1]);
    
write_coord(origin[2]);
    
write_byte(30);//R 
    
write_byte(255);//r
    
write_byte(0);//g 
    
write_byte(0);//b 
    
write_byte(60);//t 
    
write_byte(20);//decay *0.1s
    
message_end();

I don't want it to be a temp entity, I would like it to be in the map forever after it was added , and when the map starts again it shouldn't be there untill it is added.
Well basically the lights will be added after voting for the map is ready.

Last edited by DarthMan; 02-24-2017 at 08:39.
DarthMan is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 02-24-2017 , 08:42   Re: Light Problem
Reply With Quote #6

Quote:
Originally Posted by DarthMan View Post
I don't want it to be a temp entity, I would like it to be in the map forever after it was added , and when the map starts again it shouldn't be there untill it is added.
Well basically the lights will be added after voting for the map is ready.
You can revive it using set_task ?
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-24-2017 , 08:51   Re: Light Problem
Reply With Quote #7

Quote:
Originally Posted by abdobiskra View Post
You can revive it using set_task ?
Ah great. 1 more thing I require is, let's say the map panel is called panel_x.
How could I then add a model for every panel with the size of the panel?
The models will basically be map images, and they should be loaded from mapvote_maps.ini .
It should pick a different map for eac panel, adn if more than 44 maps are in the ini it shouldn't repeat any of them, so for each panel a different map, if there are less than 44 maps, it should repeat depending on how many maps are in the ini etc. So if I ahve 15 maps for example it should repeat 3 tmes, so 15 maps, 15 maps and 14 for 44 panels to be filled. Thanks!
DarthMan is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-24-2017 , 09:46   Re: Light Problem
Reply With Quote #8

Quote:
Originally Posted by DarthMan View Post
I don't want it to be a temp entity, I would like it to be in the map forever after it was added , and when the map starts again it shouldn't be there untill it is added.
Well basically the lights will be added after voting for the map is ready.
Here I need some help :

Code:
public create_light(origin[3])
{
    while( ( ent= find_ent_by_tname( ent, "glass_votemap" ) ) )
    { 
    origin[0] = 5, origin[1] = -2224, origin[2] = -165
    message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
    write_byte(TE_DLIGHT);
    write_coord(origin[0]);
    write_coord(origin[1]);
    write_coord(origin[2]);
    write_byte(30);//R 
    write_byte(255);//r
    write_byte(0);//g 
    write_byte(0);//b 
    write_byte(60);//t 
    write_byte(20);//decay *0.1s
    message_end();    	
    }
}
I want origin[0] and origin[1] to be the origins of the window entity, and so to assign a light for each entity with the glass_votemap name. Thanks !
DarthMan is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 02-24-2017 , 11:46   Re: Light Problem
Reply With Quote #9

just get origin :
when you aiming to this window ! say /get
PHP Code:
public plugin_init() {

   
register_clcmd("say /get","Get")
}
public 
Get(id){
   new 
origin[3]
   
get_user_origin(idorigin3)
   
client_print(idprint_chat"origin ------> %d %d %d",origin[0],origin[1],origin[2])

__________________

Last edited by abdobiskra; 02-24-2017 at 11:47.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
DarthMan
Veteran Member
Join Date: Aug 2011
Old 02-24-2017 , 11:48   Re: Light Problem
Reply With Quote #10

Quote:
Originally Posted by abdobiskra View Post
just get origin :
when you aiming to this window ! say /get
PHP Code:
public plugin_init() {

   
register_clcmd("say /get","Get")
}
public 
Get(id){
   new 
origin[3]
   
get_user_origin(idorigin3)
   
client_print(idprint_chat"origin ------> %d %d %d",origin[0],origin[1],origin[2])

No it's not that. Basically what I want is I created a task : set_task(6.0, "create_light", 0, "", 0, "b", 0).
On that task I want to automatically create lights for every glass_votemap entity.

Last edited by DarthMan; 02-24-2017 at 11:49.
DarthMan 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 23:41.


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