AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Light Maker fix light. (https://forums.alliedmods.net/showthread.php?t=156247)

HBxander 05-03-2011 09:19

Light Maker fix light.
 
Hi there.. I've made this lightmaker plugin, but it wont make the lights like umm.. ill try explain..

now i got the code ( under these lines ), and atm, i can stand on the light like a box and so on.. but i want it to be so i cant stand on it? dunno how to! :s

PHP Code:

CreateLightAiming(const id)
{
    if ( !
g_admin[id] && !g_gived_access[id] )
    {
        
console_print(id"You have no access to that command");
        return 
PLUGIN_HANDLED;
    }
    
    static 
origin[3];
    static 
Float:float_origin[3];
    
    
get_user_origin(idorigin3);
    
IVecFVec(originfloat_origin);
    
float_origin[2] += 4.0;
    
    
CreateLight(float_origin"15""255""255""255");
    
    return 
PLUGIN_HANDLED;
}

CreateLight(Float:origin[3], const radius[], const color_red[], const color_green[], const color_blue[])
{
    new 
ent create_entity("info_target");
    if ( !
is_valid_ent(ent) ) return 0;
    
    
entity_set_origin(entorigin);
    
entity_set_model(entg_sprite_light);
    
entity_set_float(entEV_FL_scale0.25);
    
entity_set_string(entEV_SZ_classnameg_light_classname);
    
entity_set_int(entEV_INT_solidSOLID_BBOX); // Isnt it just removing this line??
    
entity_set_int(entEV_INT_movetypeMOVETYPE_NONE);
    
    
entity_set_size(entFloat:{ -3.0, -3.0, -6.0 }, Float:{ 3.03.06.0 });
    
    static 
Float:color[3];
    
color[0] = str_to_float(color_red);
    
color[1] = str_to_float(color_green);
    
color[2] = str_to_float(color_blue);
    
    
entity_set_vector(entEV_VEC_rendercolorcolor);
    
    
SetProperty(ent1radius);
    
SetProperty(ent2color_red);
    
SetProperty(ent3color_green);
    
SetProperty(ent4color_blue);
    
    
entity_set_float(entEV_FL_nextthinkget_gametime() + 0.01);
    
    return 
ent;



jc980 05-03-2011 09:29

Re: Light Maker fix light.
 
havent you used TE_DLIGHT?

message_begin(MSG_ONE_UNRELIABLE, SVC_TEMPENTITY, _, id)
write_byte(TE_DLIGHT) // TE id
write_coord(origin[0]) // x
write_coord(origin[1]) // y
write_coord(origin[2]) // z
write_byte(radius) // radius
write_byte(color_red) // r
write_byte(color_green) // g
write_byte(color_blue) // b
write_byte(get_gametime()) // life
write_byte(0) // decay rate
message_end()

PS: you need id.

HBxander 05-03-2011 09:31

Re: Light Maker fix light.
 
No i dont need to use id dude :-)

- all i need to know is how i do remove make it not solid.. :)

pRoxxxDD 05-03-2011 09:35

Re: Light Maker fix light.
 
SOLID_NOT ?

HBxander 05-03-2011 09:37

Re: Light Maker fix light.
 
ye, but how ? just like this ;
PHP Code:

entity_set_int entEV_INT_solidSOLID_NOT 

or what?

E: havent used solid stuff before just seen this in another plugin and would test it, dont normally use stuff like this :-)

pRoxxxDD 05-04-2011 05:38

Re: Light Maker fix light.
 
Quote:

Originally Posted by HBxander (Post 1462495)
ye, but how ? just like this ;
PHP Code:

entity_set_int entEV_INT_solidSOLID_NOT 

or what?

E: havent used solid stuff before just seen this in another plugin and would test it, dont normally use stuff like this :-)

Yup, and you don't need this string:
PHP Code:

 entity_set_size(entFloat:{ -3.0, -3.0, -6.0 }, Float:{ 3.03.06.0 }); 



All times are GMT -4. The time now is 04:20.

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