Raised This Month: $ Target: $400
 0% 

How to remove entites for 1 round?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 05-04-2010 , 17:23   How to remove entites for 1 round?
Reply With Quote #1

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" ) ); 
KadiR is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-04-2010 , 17:31   Re: How to remove entites for 1 round?
Reply With Quote #2

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.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 05-04-2010 , 17:51   Re: How to remove entites for 1 round?
Reply With Quote #3

Quote:
Originally Posted by wrecked_ View Post
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.
KadiR is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-04-2010 , 18:20   Re: How to remove entites for 1 round?
Reply With Quote #4

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 20 hours, sorry if I don't reply quickly.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 05-05-2010 , 00:55   Re: How to remove entites for 1 round?
Reply With Quote #5

I know how to use set_rendering, but I don'^t have any idea about the array storage.
KadiR is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-05-2010 , 01:17   Re: How to remove entites for 1 round?
Reply With Quote #6

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 );         }     } }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-05-2010 , 01:20   Re: How to remove entites for 1 round?
Reply With Quote #7

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.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-05-2010 , 01:21   Re: How to remove entites for 1 round?
Reply With Quote #8

@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.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-05-2010 , 01:37   Re: How to remove entites for 1 round?
Reply With Quote #9

Quote:
Originally Posted by Exolent[jNr] View Post
@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.
So they're just open value holders? Does that mean I'd just be able to set values, like 1 or 0 to see if the entity has a certain property, then get it later on to check if it has the needed property, or did I misinterpret what you were saying?
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-05-2010 , 01:41   Re: How to remove entites for 1 round?
Reply With Quote #10

Quote:
Originally Posted by Exolent[jNr] View Post
@Connor
I just like to show possible solutions.
I think it's a bad idea to show solution as #2
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



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 03:32.


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