AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to remove entites for 1 round? (https://forums.alliedmods.net/showthread.php?t=126029)

KadiR 05-04-2010 17:23

How to remove entites for 1 round?
 
As the topic already says, like this which is called by a function.

PHP Code:

remove_entityfind_ent_by_model( -1"entity_name""*model_index_number" ) ); 


wrecked_ 05-04-2010 17:31

Re: How to remove entites for 1 round?
 
I'd just set the entity to be invisible and be not solid, then store its index in a dynamic array. At round start, you can loop through all of the array indices in your dynamic array (holding the index of the entities removed) and set their normal alpha / solidity back to normal.

KadiR 05-04-2010 17:51

Re: How to remove entites for 1 round?
 
Quote:

Originally Posted by wrecked_ (Post 1170672)
I'd just set the entity to be invisible and be not solid, then store its index in a dynamic array. At round start, you can loop through all of the array indices in your dynamic array (holding the index of the entities removed) and set their normal alpha / solidity back to normal.

Well I really don't know how to make that, it would be kind if you can help me more.

wrecked_ 05-04-2010 18:20

Re: How to remove entites for 1 round?
 
Which parts don't you know? For the rendering either use set_rendering (fun) or set_pev(fakemeta, info on pev values) with pev_render type of values.

For the array storage, you just use the functions listed in cellarray.inc (lol it sounds like celery). ArrayPushArray, ArrayGetArray, ArraySize, etc.

EDIT: I'll be back in 2:30 hours, sorry if I don't reply quickly.

KadiR 05-05-2010 00:55

Re: How to remove entites for 1 round?
 
I know how to use set_rendering, but I don'^t have any idea about the array storage. :cry:

wrecked_ 05-05-2010 01:01

Re: How to remove entites for 1 round?
 
zomg look example!

https://forums.alliedmods.net/showth...highlight=hide

Exolent[jNr] 05-05-2010 01:17

Re: How to remove entites for 1 round?
 
Method #1:
Code:
#include < amxmodx > #include < engine > const HIDDEN_ENTITY_IDENTIFIER = 1234567890; HideEntityByModel( const szClassName[ ], const szModel[ ] ) {     new iEntity = -1;     new Float:vecRenderColor[ 3 ];         while( ( iEntity = find_ent_by_model( iEntity, szClassName, szModel ) ) )     {         entity_set_int( iEntity, EV_INT_iuser1, entity_get_int( iEntity, EV_INT_solid ) );                 entity_set_int( iEntity, EV_INT_solid, SOLID_NOT );                 entity_set_int( iEntity, EV_INT_iuser2, entity_get_int( iEntity, EV_INT_renderfx ) );         entity_get_vector( iEntity, EV_VEC_rendercolor, vecRenderColor );         entity_set_vector( iEntity, EV_VEC_vuser1, vecRenderColor );         entity_set_int( iEntity, EV_INT_iuser3, entity_get_int( iEntity, EV_INT_rendermode ) );         entity_set_float( iEntity, EV_FL_fuser1, entity_get_float( iEntity, EV_FL_renderamt ) );                 set_rendering( iEntity, kRenderFxNone, 0, 0, 0, kRenderTransTexture, 0 );                 entity_set_int( iEntity, EV_INT_iuser4, HIDDEN_ENTITY_IDENTIFIER );     } } ShowEntityByModel( const szClassName[ ], const szModel[ ] ) {     new iEntity = -1;     new Float:vecRenderColor[ 3 ];         while( ( iEntity = find_ent_by_model( iEntity, szClassName, szModel ) ) )     {         if( entity_get_int( iEntity, EV_INT_iuser4 ) == HIDDEN_ENTITY_IDENTIFIER )         {             entity_set_int( iEntity, EV_INT_solid, entity_get_int( iEntity, EV_INT_iuser1 ) );                         entity_set_int( iEntity, EV_INT_renderfx, entity_get_int( iEntity, EV_INT_iuser2 ) );             entity_get_vector( iEntity, EV_VEC_vuser1, vecRenderColor );             entity_set_vector( iEntity, EV_VEC_rendercolor, vecRenderColor );             entity_set_int( iEntity, EV_INT_rendermode, entity_get_int( iEntity, EV_INT_iuser3 ) );             entity_set_float( iEntity, EV_FL_renderamt, entity_get_float( iEntity, EV_FL_fuser1 ) );                         entity_set_int( iEntity, EV_INT_iuser4, 0 );         }     } }

Method #2:
Code:
#include < amxmodx > #include < engine > #include < fakemeta > const HIDDEN_ENTITY_IDENTIFIER = 1234567890; public plugin_init( ) {     register_forward( FM_AddToFullPack, "FwdAddToFullPack", 1 ); } public FwdAddToFullPack( esHandle, e, iEntity, iHost, iHostFlags, iPlayer, pSet ) {     if( !iPlayer && is_user_alive( iHost ) )     {         if( entity_get_int( iEntity, EV_INT_iuser4 ) == HIDDEN_ENTITY_IDENTIFIER )         {             set_es( esHandle, ES_Origin, Float:{ 9999.0, 9999.0, 9999.0 } );         }     } } HideEntityByModel( const szClassName[ ], const szModel[ ] ) {     new iEntity = -1;         while( ( iEntity = find_ent_by_model( iEntity, szClassName, szModel ) ) )     {         entity_set_int( iEntity, EV_INT_iuser4, HIDDEN_ENTITY_IDENTIFIER );     } } ShowHiddenEntityByModel( const szClassName[ ], const szModel[ ] ) {     new iEntity = -1;         while( ( iEntity = find_ent_by_model( iEntity, szClassName, szModel ) ) )     {         if( entity_get_int( iEntity, EV_INT_iuser4 ) == HIDDEN_ENTITY_IDENTIFIER )         {             entity_set_int( iEntity, EV_INT_iuser4, 0 );         }     } }

ConnorMcLeod 05-05-2010 01:20

Re: How to remove entites for 1 round?
 
AddToFullPack oO

All you have to do is to add EF_NODRAW to effects, store solid and set it to SOLID_NOT.
Make a system to mark/store entities list.
Restore solid and remove EF_NODRAW from effects.

wrecked_ 05-05-2010 01:21

Re: How to remove entites for 1 round?
 
Exolent, could you explain those iuser* and vuser* entity properties? I'd seen them a few times but never really grasped what their meaning was. xPaw's Pev Research didn't have anything on them, either.

Exolent[jNr] 05-05-2010 01:21

Re: How to remove entites for 1 round?
 
@Connor
It may not be the most efficient.
I just like to show possible solutions.

@wrecked
They are basically extra values available to be set on entities.
However, some entities use them. For example, players use iuser1 and iuser2 for spectator properties.


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

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