Raised This Month: $ Target: $400
 0% 

Can only kill sentry once per hook(?)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
SomePanns
Senior Member
Join Date: Dec 2013
Old 08-20-2017 , 05:57   Can only kill sentry once per hook(?)
Reply With Quote #1

I want to destroy all sentries owned/built by a client when they die, but it only works the first time you die. The other times you die, your sentries won't get destroyed. Any ideas?

PHP Code:
void ClearSentries(int client)
{
    
int maxentities GetMaxEntities();                                                        
    for (
int i MAXPLAYERS+1<= maxentitiesi++)                                        
    {
        if(
IsValidEntity(i)) 
        {
            
char iObject[128];
            
GetEntityNetClass(iiObjectsizeof(iObject));

            if(
strcmp(iObject"CObjectSentrygun") == 0)
            {
                if(
GetEntDataEnt2(iFindSendPropInfo("CObjectSentrygun""m_hBuilder")) == client)
                {
                    
SetVariantInt(9999);
                    
AcceptEntityInput(i"RemoveHealth");
                }
            }
        }
    }


Last edited by SomePanns; 08-20-2017 at 05:57.
SomePanns 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 01:29.


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