Raised This Month: $68 Target: $400
 17% 

[CSS]Antihostagekill


Post New Thread Reply   
 
Thread Tools Display Modes
Author
1337norway
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 - 584 views - 807 Bytes)
    __________________
    Taking Free/Paid Requests! Send a PM
    --->Donate here if you like my work. <--- (or ask for my paypal in private)

    Last edited by 1337norway; 12-28-2015 at 10:41.
    1337norway 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
    1337norway
    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.
    __________________
    Taking Free/Paid Requests! Send a PM
    --->Donate here if you like my work. <--- (or ask for my paypal in private)

    Last edited by 1337norway; 12-28-2015 at 12:24.
    1337norway 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 21:12.


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