AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Zombie plague bug (https://forums.alliedmods.net/showthread.php?t=134546)

Emp0wer 08-06-2010 04:55

Zombie plague bug
 
Hello. In zombie plague this message is sent every 0.1second for players to update nemesis aura.
PHP Code:

    engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_DLIGHT// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[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_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_ELIGHT// TE id
    
write_short(id)
    
engfunc(EngFunc_WriteCoordoriginF[0]) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]) // z
    
write_coord20 )  // radius
    
write_byte(150// r
    
write_byte(0// g
    
write_byte(0// b
    
write_byte(255// life
    
write_coord)  // 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(idpev_effectspev(idpev_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?

minimiller 08-06-2010 11:58

Re: Zombie plague bug
 
and you wonder why you got banned last time?

Emp0wer 08-06-2010 14:43

Re: Zombie plague bug
 
Quote:

Originally Posted by minimiller (Post 1263339)
and you wonder why you got banned last time?

I was banned because of helping non-steam player. Please no offtop.

infek 08-07-2010 06:07

Re: Zombie plague bug
 
As I said in most threads Check The Error Logs when you get Over flowed.
And also do you even have message_begin()

Emp0wer 08-07-2010 11:02

Re: Zombie plague bug
 
Quote:

Originally Posted by infek (Post 1264012)
As I said in most threads Check The Error Logs when you get Over flowed.

Overflowing is bcz of a lot messages are sent to update aura I don't need to check logs, I know that for sure.

Quote:

Originally Posted by infek (Post 1264012)
And also do you even have message_begin()

open your eyes:
PHP Code:

engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0



All times are GMT -4. The time now is 00:10.

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