Raised This Month: $ Target: $400
 0% 

make ent visible and solid only for owner


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
red_bull2oo6
Senior Member
Join Date: Mar 2012
Location: Braila, Romania
Old 05-13-2014 , 18:05   Re: make ent visible and solid only for owner
Reply With Quote #4

i did, and i tried some 'methods' by myself but i didn't figured it out.

here is one of them i found.
it makes it invisible but it's still solid.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < fakemeta >
#include < engine >

#pragma semicolon 1

new const
PLUGIN_NAME[ ]         = "New Plugin",
PLUGIN_VERSION[ ]     = "1.0";

new const 
g_szModel[ ]         = "models/player/sas/sas.mdl";
new const 
g_szClassName[ ]    = "CustomNPC";


new 
g_iNPC33 ];

public 
plugin_precache( )    precache_modelg_szModel );

public 
plugin_init( )
{
    
    
register_pluginPLUGIN_NAMEPLUGIN_VERSION"Askhanar" );
    
register_clcmd"say /npc""ClCmdSayNPC" );
    
    
register_forwardFM_AddToFullPack"fw_AddToFullPackPre"false );
    
register_thinkg_szClassName"think_NPC" );
    
    
// Add your code here...
}

public 
client_putinserverid )    g_iNPCid ] = -99;
public 
client_disconnectid )
    if( 
g_iNPCid ] > )
        
remove_entityg_iNPCid ] );

public 
ClCmdSayNPCid )
{
    
g_iNPCid ] = CreateNPCid );
}

public 
fw_AddToFullPackes_handleeenthosthostflagsplayerpset )
{
    
    if( !
player )
    {
        static 
szClassName32 ];
        
entity_get_stringentEV_SZ_classnameszClassNamesizeofszClassName ) -);
        
        if( 
equalszClassNameg_szClassName )
            && 
entity_get_intentEV_INT_iuser1 ) != host )
        {
            
            
set_eses_handleES_Origin, { 999999999.0999999999.0999999999.0 } );
            
set_eses_handleES_RenderModekRenderTransAlpha );
            
set_eses_handleES_RenderAmt);
            
            
set_eses_handleES_SolidSOLID_NOT );
        }
    }
    
}

public 
think_NPCiEnt )
{
    
    
entity_set_floatiEntEV_FL_nextthinkget_gametime() + 1.7 );
    
    static 
Floatmins[3], Floatmaxs[3];
    
pev(iEntpev_absminmins);
    
pev(iEntpev_absmaxmaxs);
    
    
//Draw a box which is the size of the bounding NPC
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
    
write_byte(TE_BOX);
    
engfunc(EngFunc_WriteCoordmins[0]);
    
engfunc(EngFunc_WriteCoordmins[1]);
    
engfunc(EngFunc_WriteCoordmins[2]);
    
engfunc(EngFunc_WriteCoordmaxs[0]);
    
engfunc(EngFunc_WriteCoordmaxs[1]);
    
engfunc(EngFunc_WriteCoordmaxs[2]);
    
write_short(100);
    
write_byte(random_num(25255));
    
write_byte(random_num(25255));
    
write_byte(random_num(25255));
    
message_end();
    
}


CreateNPC(idFloat:fOrigin]= { 0.00.00.0 }, Float:fAngle]= { 0.00.00.0 } )
{

    new 
iEnt  create_entity("info_target");
    
    
entity_set_stringiEntEV_SZ_classnameg_szClassName );
    
entity_get_vectoridEV_VEC_originfOrigin );
    
entity_set_originiEntfOrigin );
    
    
fOrigin] += 80;
    
entity_set_originidfOrigin );
    
    
entity_get_vectoridEV_VEC_anglesfAngle );
    
fAngle] = 0.0;
    
entity_set_vectoriEntEV_VEC_anglesfAngle );
    
    
    
entity_set_model(iEntg_szModel );
    
entity_set_int(iEntEV_INT_movetypeMOVETYPE_NONE );
    
    
entity_set_int(iEntEV_INT_solidSOLID_BBOX );
    
entity_set_int(iEntEV_INT_iuser1id );
    
    
//Create a bounding box for oru NPC
    
static Floatmins[3] = {-16.0, -16.0, -36.0 };
    static 
Floatmaxs[3] = { 16.016.036.0 };
    
    
entity_set_size(iEntminsmaxs);
    
entity_set_byteiEntEV_BYTE_controller1125 );
    
drop_to_floor(iEnt );
    
    
//set_rendering( iEnt, kRenderFxDistort, 0, 0, 0, kRenderTransAdd, 255 );
    
    //Make it instantly think
    
entity_set_floatiEntEV_FL_nextthinkget_gametime() + 0.01 );
    
    return 
iEnt;


__________________

My PC Themes . .

Last edited by red_bull2oo6; 05-13-2014 at 18:07.
red_bull2oo6 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:03.


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