AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   night vision customized (https://forums.alliedmods.net/showthread.php?t=88814)

alan_el_more 03-29-2009 12:07

night vision customized
 
how can I give a nightvision customized to a player?
customized i refer to set the color (R G B)

ot_207 03-29-2009 12:11

Re: night vision customized
 
PHP Code:

dynamic_light_on_player(id,Float:origin[3], red 255green 255blue 255)
{
    
message_begin(MSG_ONE,SVC_TEMPENTITY,_,id)
    
write_byte(TE_DLIGHT// The light effect
    
engfunc(EngFunc_WriteCoord,origin[0]) // x
    
engfunc(EngFunc_WriteCoord,origin[1]) // y
    
engfunc(EngFunc_WriteCoord,origin[2]) // z
    
write_byte(75// radius
    
write_byte(red// r
    
write_byte(green// g
    
write_byte(blue// b
    
write_byte(4// life
    
write_byte(120// decay rate
    
message_end()


You need to refresh the message, the light is a temp entity!

alan_el_more 03-29-2009 12:23

Re: night vision customized
 
Quote:

Originally Posted by ot_207 (Post 792298)
PHP Code:

dynamic_light_on_player(id,Float:origin[3], red 255green 255blue 255)
{
    
message_begin(MSG_ONE,SVC_TEMPENTITY,_,id)
    
write_byte(TE_DLIGHT// The light effect
    
engfunc(EngFunc_WriteCoord,origin[0]) // x
    
engfunc(EngFunc_WriteCoord,origin[1]) // y
    
engfunc(EngFunc_WriteCoord,origin[2]) // z
    
write_byte(75// radius
    
write_byte(red// r
    
write_byte(green// g
    
write_byte(blue// b
    
write_byte(4// life
    
write_byte(120// decay rate
    
message_end()


You need to refresh the message, the light is a temp entity!

thanks
always helping :D

alan_el_more 03-29-2009 12:49

Re: night vision customized
 
first, sorry for the double post
second, how do i run the dynamic_light_on_player?
dynamic_light_on_player(id, ???, 255, 0, 0)

ot_207 03-29-2009 12:52

Re: night vision customized
 
origin is the player origin :). get his origin and place it in here.

alan_el_more 03-29-2009 13:02

Re: night vision customized
 
But How would it be?

ot_207 03-29-2009 13:18

Re: night vision customized
 
PHP Code:

new Float:origin[3]
// engine
entity_get_vec(id,EV_VEC_origin,origin)
// fakemeta
pev(id,pev_origin,origin


ConnorMcLeod 03-29-2009 13:19

Re: night vision customized
 
SchlumPF found a good way to make a custom nvg, let him provide or not his code.
Code uses ScreenFade thought, so you would have to implement flash in it.

BOYSplayCS 03-29-2009 13:20

Re: night vision customized
 
Fakemeta would be more efficient in this case.

ConnorMcLeod 03-29-2009 13:25

Re: night vision customized
 
Quote:

Originally Posted by BOYSplayCS (Post 792372)
Fakemeta would be more efficient in this case.

Why ?


My guess is get_user_origin + write_coord would be more efficient.


All times are GMT -4. The time now is 08:58.

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