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

Can only kill sentry once per hook(?)


Post New Thread Reply   
 
Thread Tools Display Modes
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
fakuivan
Senior Member
Join Date: Nov 2015
Old 08-21-2017 , 08:36   Re: Can only kill sentry once per hook(?)
Reply With Quote #2

Use a global book array, each element should represent if the player at the index died once, check it before you call ClearSentries on him.
__________________
fakuivan 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 17:06.


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