View Single Post
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 12-03-2018 , 01:05   Re: real time light entities
Reply With Quote #2

Code:
stock bool:createSquare(Float:vAngles[3],Float:vOrigin[3])
{ 
   	ent = create_entity( "info_target" );
	
   	if (is_valid_ent(ent)) 
   	{
		entity_set_string( ent , EV_SZ_classname, "square");
		entity_set_int(ent, EV_INT_solid, SOLID_BBOX); 
      		entity_set_int(ent, EV_INT_movetype, MOVETYPE_NONE); 
      		entity_set_model(ent, SQUARE); 
		entity_set_size( ent , Float:{ -80.0, -90.0, 0.0 }, Float:{ 80.0, 90.0, 10.0 } );
		entity_set_vector(ent, EV_VEC_angles, vAngles);
                entity_set_int(ent, EV_INT_fixangle , 1 );
      		entity_set_origin(ent, vOrigin);

                message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
                write_byte(TE_DLIGHT) // 27
                write_coord(floatround(vOrigin[0])) // x
                write_coord(floatround(vOrigin[1])) // y
                write_coord(floatround(vOrigin[2])) // z
                write_byte(50) // radius
                write_byte(50) // Red
                write_byte(255) // Green
                write_byte(255) // Blue
                write_byte(255) // life
                write_byte(60) // decay rate
                message_end()
   	}

}

Last edited by raizo11; 12-03-2018 at 01:07.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11