Raised This Month: $ Target: $400
 0% 

Distance between hostage and a player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 12-26-2008 , 12:13   Distance between hostage and a player
Reply With Quote #1

Hi.
I was wondering what is the max. distance between a player and a hostage, enough to trigger "Touched_A_Hostage".
Or i'd like an example of checking if a player pressed USE button to stop the hostage following him. ( i have an ideea but i'm not sure about it and is kinda poor )

Thanks.
__________________

anakin_cstrike is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-26-2008 , 12:27   Re: Distance between hostage and a player
Reply With Quote #2

In cs1.6, max distance you can be from an hostage and press +use so the hostage follows you is ~86 units
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 12-26-2008 , 12:30   Re: Distance between hostage and a player
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
In cs1.6, max distance you can be from an hostage and press +use so the hostage follows you is ~86 units
Thanks, i'll try.

ps: my mistake, i forgot to tell is for 1.6

EDIT: this doesn't help me very much. Still i have no idea...
__________________

anakin_cstrike is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 12-26-2008 , 12:36   Re: Distance between hostage and a player
Reply With Quote #4

http://forums.alliedmods.net/showthread.php?t=28405
SnoW is offline
Send a message via MSN to SnoW
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-26-2008 , 12:59   Re: Distance between hostage and a player
Reply With Quote #5

But what do you want to do ?

Modify the distance ?

Also, you can have a look there, but it was made for condition zero :
https://forums.alliedmods.net/showthread.php?t=82482
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Old 12-26-2008, 13:40
anakin_cstrike
This message has been deleted by anakin_cstrike. Reason: opss
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 12-26-2008 , 13:41   Re: Distance between hostage and a player
Reply With Quote #6

Just an example:

- when press USE: "the hostage is following you"
- another USE press: "the hostage is not following you any more"

or smth like that...
thanks.
__________________

anakin_cstrike is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 12-26-2008 , 13:53   Re: Distance between hostage and a player
Reply With Quote #7

One more thing about hostages. I know there is a thread 'how to remove a hostage from radar', but i can't find it...
__________________

anakin_cstrike is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 12-29-2008 , 10:17   Re: Distance between hostage and a player
Reply With Quote #8

Nobody ?
__________________

anakin_cstrike is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 12-29-2008 , 10:28   Re: Distance between hostage and a player
Reply With Quote #9

Quote:
Originally Posted by anakin_cstrike View Post
One more thing about hostages. I know there is a thread 'how to remove a hostage from radar', but i can't find it...
HL event HostagePos, start message and then just set the coords out of the map.
SnoW is offline
Send a message via MSN to SnoW
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 12-29-2008 , 12:23   Re: Distance between hostage and a player
Reply With Quote #10

Try this:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>

#define VERSION "1.0"
#define HOSTAGE_CLASSNAME    "hostage_entity"

new g_iUsedBy];

public 
plugin_init()
{
    
register_plugin"Catch Using a Hostage"VERSION"Dores" );
    
    if( !
engfuncEngFunc_FindEntityByString, -1"classname"HOSTAGE_CLASSNAME ) )
    {
        return;
    }
    
    
register_forwardFM_Think"Forward_Think" );
    
register_event"HLTV""ev_newRound""a""1=0""2=0" );
}

public 
Forward_Thinkent )
{
    static 
szClass22 ] ; peventpev_classnameszClasscharsmaxszClass ) );
    
    if( !
equalszClassHOSTAGE_CLASSNAME ) )
        return 
FMRES_IGNORED;
    
    new 
hid cs_get_hostage_ident );
    new 
foll cs_get_hostage_follent );
    if( !( 
<= foll <= get_maxplayers() ) && foll != // Not following a player.
        
return FMRES_IGNORED;
    
    if( !
foll // Not following anything.
    
{
        if( 
g_iUsedhid ] )
        {
            
client_printg_iUsedhid ], print_chat"You are not followed by a hostage anymore." );
            
g_iUsedhid ] = 0;
        }
    }
    
    else
    {
        if( !
g_iUsedByhid ] )
        {
            
client_printfollprint_chat"You are now followed by a hostage[ID: %d]."hid );
            
g_iUsedByhid ] = foll;
        }
    }
    
    return 
FMRES_IGNORED;
}

public 
ev_newRound()
{
    for( new 
sizeof g_iUsedBy i++ )
    {
        
g_iUsedBy] = 0;
    }

__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores 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 09:09.


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