Raised This Month: $ Target: $400
 0% 

Entity question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GasmoN
Member
Join Date: Jul 2014
Old 03-09-2018 , 15:35   Entity question
Reply With Quote #1

This code will reset any block that is around doors at zombie spawn.
But the problem is that if there are two doors, plugin is removing blocks
at the center between these two doors. How to fix that?

PHP Code:
// plugin_init
    
new Float:mins[3], Float:maxs[3]
    
    
g_iEntBarrier find_ent_by_tname( -1"barrier" );
    
    
entity_get_vector(g_iEntBarrierEV_VEC_minsmins);
    
entity_get_vector(g_iEntBarrierEV_VEC_maxsmaxs);
    
    
g_fBarrierOrigin[0] = (mins[0] + maxs[0]) / 2.0
    g_fBarrierOrigin
[1] = (mins[1] + maxs[1]) / 2.0
    g_fBarrierOrigin
[2] = (mins[2] + maxs[2]) / 2.0 
PHP Code:
// Triggered when player release block

new entity = -1
while( ( entity engfuncEngFunc_FindEntityInSphereentityg_fBarrierOrigin200.0 ) ) != )
{
    if (
entity == ent)
    {
        
ColorChat(idCHATCOLOR_RED"$g%s$t %L"BB_PREFIXid"BBBM_BLOCK_SPAWN")
        
        
engfuncEngFunc_SetOriginentityFloat:{ 0.00.00.0 } );
        
//g_iOwnedEntities[BlockLocker(ent)]--
        
g_EntMover[ent] = 0
        g_EntOwner
[ent] = 0
    
}

GasmoN is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 03-10-2018 , 07:10   Re: Entity question
Reply With Quote #2

I'm not sure, But I think those 2 doors are 1 entity. You could make something, that would load data from a file for every map separately.
__________________
retired chump
DjSoftero is offline
GasmoN
Member
Join Date: Jul 2014
Old 03-10-2018 , 12:48   Re: Entity question
Reply With Quote #3

I thought about that but the problem is im not sure how to check if block is on given coordinates.
GasmoN is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 03-11-2018 , 01:11   Re: Entity question
Reply With Quote #4

instead of plugin_init part of the code, create a system to read/write mins and max of the entrance and save it to a file. After that, loop through 2 separate bounds instead of only one
__________________
retired chump
DjSoftero is offline
GasmoN
Member
Join Date: Jul 2014
Old 03-11-2018 , 07:38   Re: Entity question
Reply With Quote #5

I'll try to do something with this, tomorrow since I don't have time today
https://forums.alliedmods.net/showpo...64&postcount=2

Last edited by GasmoN; 03-11-2018 at 08:18.
GasmoN 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 01:19.


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