Hello. In zombie plague this message is sent every 0.1second for players to update nemesis aura.
PHP Code:
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_DLIGHT) // TE id
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[2]) // z
write_byte(20) // radius
write_byte((g_nemesis[id] || g_nodamage[id]) ? get_pcvar_num(cvar_nemnvgcolor[0]) : get_pcvar_num(cvar_nvgcolor[0])) // r
write_byte((g_nemesis[id] || g_nodamage[id]) ? get_pcvar_num(cvar_nemnvgcolor[1]) : get_pcvar_num(cvar_nvgcolor[1])) // g
write_byte((g_nemesis[id] || g_nodamage[id]) ? get_pcvar_num(cvar_nemnvgcolor[2]) : get_pcvar_num(cvar_nvgcolor[2])) // b
write_byte(2) // life
write_byte(0) // decay rate
message_end()
If there is 1 nemesis my players ping go up, if there are a lot of them my players is just kicked "reliable channel overflowed", or start lagging very much.
I attached aura to nemesis player entity(so we don't need to update origin every 0.1s) and made longer life, so now we don't need to send that messages every 0.1s, but I don't why this message only glows entity id, but not all around in the radius like that should be:
PHP Code:
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_ELIGHT) // TE id
write_short(id)
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[2]) // z
write_coord( 20 ) // radius
write_byte(150) // r
write_byte(0) // g
write_byte(0) // b
write_byte(255) // life
write_coord( 0 ) // decay rate
message_end()
Maybe there is other option to make red aura without updating it every 0.1second?
Also it's possible to set bright aura like this:
PHP Code:
set_pev(id, pev_effects, pev(id, pev_effects) | EF_BRIGHTLIGHT)
So maybe we can change it's color to red? Maybe this light is an entity so can find it and change the color? But what classname would it have?