Raised This Month: $32 Target: $400
 8% 

[CSS]Antihostagekill


Post New Thread Reply   
 
Thread Tools Display Modes
Author
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Plugin ID:
4976
Plugin Version:
1.0
Plugin Category:
General Purpose
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Prevent players from killing the hostages.
    Old 12-27-2015 , 18:22   [CSS]Antihostagekill
    Reply With Quote #1

    Just made a quick plugin to prevent players from killing the hostages. So they cant ruin the gameplay for people who are trying to do the objective.

    Install smx > addons/sourcemod/plugins
    sp > addons/sourcemod/scripting

    Have fun
    Attached Files
    File Type: sp Get Plugin or Get Source (antihostagekill.sp - 1229 views - 807 Bytes)
    __________________
    I highly recommend joining the SourceMod Discord Server for real time support.

    Last edited by backwards; 12-28-2015 at 10:41.
    backwards is offline
    ch4os
    Member
    Join Date: Jun 2014
    Old 12-28-2015 , 08:42   Re: [css/any?] Antihostagekill
    Reply With Quote #2

    I think this here is even quicker as it doesn't have to cycle through all the available entities:

    PHP Code:
    GodModeHostages()
    {
        new 
    entity = -1;
        while ((
    entity FindEntityByClassname(entity"hostage_entity")) != -1)
            
    SetEntProp(entityProp_Data"m_takedamage"1);

    Untested

    BTW: In CS:GO you actually can't kill the hostages anymore, so this is only for CSS I guess
    ch4os is offline
    backwards
    AlliedModders Donor
    Join Date: Feb 2014
    Location: USA
    Old 12-28-2015 , 12:00   Re: [css/any?] Antihostagekill
    Reply With Quote #3

    Quote:
    Originally Posted by ch4os View Post
    I think this here is even quicker as it doesn't have to cycle through all the available entities:

    PHP Code:
    GodModeHostages()
    {
        new 
    entity = -1;
        while ((
    entity FindEntityByClassname(entity"hostage_entity")) != -1)
            
    SetEntProp(entityProp_Data"m_takedamage"1);

    Untested

    BTW: In CS:GO you actually can't kill the hostages anymore, so this is only for CSS I guess
    How do you think FindEntityByClassname works?

    Code:
    CBaseEntity *CGlobalEntityList::FindEntityByClassname( CBaseEntity *pStartEntity, const char *szName )
    {
        const CEntInfo *pInfo = pStartEntity ? GetEntInfoPtr( pStartEntity->GetRefEHandle() )->m_pNext : FirstEntInfo();
    
        for ( ;pInfo; pInfo = pInfo->m_pNext )
        {
            CBaseEntity *pEntity = (CBaseEntity *)pInfo->m_pEntity;
            if ( !pEntity )
            {
                DevWarning( "NULL entity in global entity list!\n" );
                continue;
            }
    
            if ( pEntity->ClassMatches(szName) )
                return pEntity;
        }
    
        return NULL;
    }
    It enumerates all entities and compares the classname. So this takes the same amount of time but thanks for attempting to correct me. also thanks for updating me on the csgo part.
    __________________
    I highly recommend joining the SourceMod Discord Server for real time support.

    Last edited by backwards; 12-28-2015 at 12:24.
    backwards is offline
    404UserNotFound
    BANNED
    Join Date: Dec 2011
    Old 12-15-2017 , 01:10   Re: [CSS]Antihostagekill
    Reply With Quote #4

    Calling a function when it's only used in one spot?

    You suck, dude.
    404UserNotFound is offline
    Reply


    Thread Tools
    Display Modes

    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:26.


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