AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to increase TE_BOX limitations? (https://forums.alliedmods.net/showthread.php?t=340922)

damage220 12-18-2022 02:19

How to increase TE_BOX limitations?
 
1 Attachment(s)
I try to show player positions with TE_BOX and it seems there is some client side limitations on this message. In the attached screenshot you can see that box covers only 4 players and 1 box edge was not rendered (player "Killer Apple"). At the same time when I use TE_GLOWSPRITE I can show many more than 16 sprites (player positions) but I kind to like this box effect. Is there any client side cvar or anything that can disable or increase limitations applied to TE_BOX?

georgik57 01-26-2023 11:29

Re: How to increase TE_BOX limitations?
 
1 Attachment(s)
Try

georgik57 01-27-2023 11:21

Re: How to increase TE_BOX limitations?
 
Sorry, posted wrong script.
Try this:
PHP Code:

public fwTaskEntShowSize(const id)
{
    if (!
pev_valid(id))
    {
        
remove_task(id)
        
        return;
    }
    
    static 
Float:fVecTemp[3], Float:fVecTemp2[3], Float:fVecTemp3[3]//, Float:fVecTemp4[3];
    
pev(idpev_originfVecTemp)
    
pev(idpev_minsfVecTemp2)
    
pev(idpev_maxsfVecTemp3)
    
//pev(id, pev_view_ofs, fVecTemp4)
    
    
xs_vec_add(fVecTempfVecTemp2fVecTemp2)
    
xs_vec_add(fVecTempfVecTemp3fVecTemp3)
/*    
    static Float:flCenter[3];
    flCenter[0] = (fVecTemp2[0] + fVecTemp3[0]) * 0.5;
    flCenter[1] = (fVecTemp2[1] + fVecTemp3[1]) * 0.5;
    flCenter[2] = (fVecTemp2[2] + fVecTemp3[2]) * 0.5;
    
    DrawLine(id, fVecTemp[0], fVecTemp[1], fVecTemp[2], flCenter[0], flCenter[1], flCenter[2], 255, 0, 0);*/
    
    
DrawLine(idfVecTemp3[0], fVecTemp3[1], fVecTemp3[2], fVecTemp2[0], fVecTemp3[1], fVecTemp3[2], 255255255);
    
DrawLine(idfVecTemp3[0], fVecTemp3[1], fVecTemp3[2], fVecTemp3[0], fVecTemp2[1], fVecTemp3[2], 255255255);
    
DrawLine(idfVecTemp3[0], fVecTemp3[1], fVecTemp3[2], fVecTemp3[0], fVecTemp3[1], fVecTemp2[2], 255255255);
    
DrawLine(idfVecTemp2[0], fVecTemp2[1], fVecTemp2[2], fVecTemp3[0], fVecTemp2[1], fVecTemp2[2], 255255255);
    
DrawLine(idfVecTemp2[0], fVecTemp2[1], fVecTemp2[2], fVecTemp2[0], fVecTemp3[1], fVecTemp2[2], 255255255);
    
DrawLine(idfVecTemp2[0], fVecTemp2[1], fVecTemp2[2], fVecTemp2[0], fVecTemp2[1], fVecTemp3[2], 255255255);
    
DrawLine(idfVecTemp2[0], fVecTemp3[1], fVecTemp3[2], fVecTemp2[0], fVecTemp3[1], fVecTemp2[2], 255255255);
    
DrawLine(idfVecTemp2[0], fVecTemp3[1], fVecTemp2[2], fVecTemp3[0], fVecTemp3[1], fVecTemp2[2], 255255255);
    
DrawLine(idfVecTemp3[0], fVecTemp3[1], fVecTemp2[2], fVecTemp3[0], fVecTemp2[1], fVecTemp2[2], 255255255);
    
DrawLine(idfVecTemp3[0], fVecTemp2[1], fVecTemp2[2], fVecTemp3[0], fVecTemp2[1], fVecTemp3[2], 255255255);
    
DrawLine(idfVecTemp3[0], fVecTemp2[1], fVecTemp3[2], fVecTemp2[0], fVecTemp2[1], fVecTemp3[2], 255255255);
    
DrawLine(idfVecTemp2[0], fVecTemp2[1], fVecTemp3[2], fVecTemp2[0], fVecTemp3[1], fVecTemp3[2], 255255255);
    
    
DrawLine(idfVecTemp2[0], fVecTemp2[1], fVecTemp2[2], fVecTemp3[0], fVecTemp3[1], fVecTemp3[2], 02550);
    
DrawLine(idfVecTemp2[0], fVecTemp2[1], fVecTemp3[2], fVecTemp3[0], fVecTemp3[1], fVecTemp2[2], 02550);
    
DrawLine(idfVecTemp2[0], fVecTemp3[1], fVecTemp2[2], fVecTemp3[0], fVecTemp2[1], fVecTemp3[2], 02550);
    
DrawLine(idfVecTemp3[0], fVecTemp2[1], fVecTemp2[2], fVecTemp2[0], fVecTemp3[1], fVecTemp3[2], 02550);
    
/*    engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, fVecTemp, 0)
    write_byte(TE_BOX)
    engfunc(EngFunc_WriteCoord, fVecTemp[0] + fVecTemp2[0])
    engfunc(EngFunc_WriteCoord, fVecTemp[1] + fVecTemp2[1])
    engfunc(EngFunc_WriteCoord, fVecTemp[2] + fVecTemp2[2])
    engfunc(EngFunc_WriteCoord, fVecTemp[0] + fVecTemp3[0])
    engfunc(EngFunc_WriteCoord, fVecTemp[1] + fVecTemp3[1])
    engfunc(EngFunc_WriteCoord, fVecTemp[2] + fVecTemp3[2])
    write_short(1) //life in 0.1 s
    write_byte(255)
    write_byte(255)
    write_byte(255)
    message_end()
    
    engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, fVecTemp, 0)
    write_byte(TE_BOX)
    engfunc(EngFunc_WriteCoord, fVecTemp[0] + fVecTemp2[0])
    engfunc(EngFunc_WriteCoord, fVecTemp[1] + fVecTemp2[1])
    engfunc(EngFunc_WriteCoord, fVecTemp[2] + fVecTemp2[2])
    engfunc(EngFunc_WriteCoord, fVecTemp[0] + fVecTemp3[0])
    engfunc(EngFunc_WriteCoord, fVecTemp[1] + fVecTemp3[1])
    engfunc(EngFunc_WriteCoord, fVecTemp[2] + fVecTemp4[2])
    write_short(1) //life in 0.1 s
    write_byte(255)
    write_byte(255)
    write_byte(255)
    message_end()*/
}

#define fm_write_coord(%1)                engfunc(EngFunc_WriteCoord, %1)

DrawLine(const id, const Float:x1, const Float:y1, const Float:z1, const Float:x2, const Float:y2, const Float:z2, const r, const g, const b)
{
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY_0);
    {
        
write_byte(TE_BEAMPOINTS);
        
fm_write_coord(x1);
        
fm_write_coord(y1);
        
fm_write_coord(z1);
        
fm_write_coord(x2);
        
fm_write_coord(y2);
        
fm_write_coord(z2);
        
write_short(g_iSpriteDot);
        
write_byte(1);    // framestart 
        
write_byte(1);    // framerate 
        
write_byte(1);    // life in 0.1's 
        
write_byte(2);    // width
        
write_byte(0);    // noise 
        
write_byte(r);    // r, g, b 
        
write_byte(g);    // r, g, b 
        
write_byte(b);    // r, g, b 
        
write_byte(200);    // brightness 
        
write_byte(0);    // speed 
    
}
    
message_end();



JocAnis 01-28-2023 12:32

Re: How to increase TE_BOX limitations?
 
nice code @georgik57, tested, few lines in code must be added
https://i.imgur.com/ICbq7WV.jpeg

lines must be added, example of sprite:

Code:

new model

public plugin_precache()
{
    model = precache_model( "sprites/zbeam4.spr" )
}
//
and later for using this stock:

set_task( 0.1, "fwTaskEntShowSize", YOUR_ENT_ID, .flags = "b" )


georgik57 01-28-2023 17:06

Re: How to increase TE_BOX limitations?
 
yup credits to schmurgel

Natsheh 01-28-2023 19:42

Re: How to increase TE_BOX limitations?
 
1 Attachment(s)
There....

This plugin will show entities for the player who's typing /checkents


All times are GMT -4. The time now is 15:33.

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