Raised This Month: $51 Target: $400
 12% 

Best way to check if player will stuck in prop_dynamic


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SideX
Senior Member
Join Date: Jun 2010
Location: Ukraine, Melitopol.
Old 01-05-2012 , 05:52   Best way to check if player will stuck in prop_dynamic
Reply With Quote #1

Situation: player wants to spawn prop_dynamic, but if any player will stuck in that prop - don't spawn it. Any ideas?

My version:
PHP Code:
...
entity SpawnProp();
if (
CheckStuckInEntity(entity))
 
AcceptEntityInput(entity"Kill"); 
CheckStuckInEntity stock:
PHP Code:
bool:CheckStuckInEntity(entity)
{
    for (new 
i=1;i<=MaxClients;i++)
    {
        if (
IsClientInGame(i) && IsPlayerAlive(i) && IsPlayerStuckInEntity(ientity))
            return 
true;
    }
    return 
false;
}

bool:IsPlayerStuckInEntity(iCliententity

    
decl Float:vecMin[3], Float:vecMax[3], Float:vecOrigin[3]; 
     
    
GetClientMins(iClientvecMin); 
    
GetClientMaxs(iClientvecMax); 
     
    
GetClientAbsOrigin(iClientvecOrigin); 
     
    
TR_TraceHullFilter(vecOriginvecOriginvecMinvecMaxMASK_SOLIDTraceEntityFilterNotEntityentity); 
     
    return 
TR_DidHit(); 


public 
bool:TraceEntityFilterNotEntity(iEntityiContentsMaskany:entity

    return 
iEntity == entity


Last edited by SideX; 01-05-2012 at 05:56.
SideX is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 01-05-2012 , 09:14   Re: Best way to check if player will stuck in prop_dynamic
Reply With Quote #2

You named the filter TraceEntityFilterNotEntity but check if the entity hits itself. Rest looks fine. zombiereloaded has a nice unstuck feature you might want to read through.
__________________
Peace-Maker is offline
Counte
Junior Member
Join Date: Sep 2011
Old 01-06-2012 , 08:19   Re: Best way to check if player will stuck in prop_dynamic
Reply With Quote #3

I dont have.
Counte 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 04:49.


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