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

[SOLVED] rescue hostage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gugie
Member
Join Date: Jul 2012
Old 11-23-2013 , 06:53   [SOLVED] rescue hostage
Reply With Quote #1

I'm trying to rescue hostage when u talk with him. So i tried to teleport hostage in ct buy zone, but hostage didn't rescue and just stayed at ct buy zone.

PHP Code:
public Action:HostageFollows(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
hostage GetEventInt(event"hostage");
    
TeleportEntity(hostagef_ct_bzNULL_VECTORNULL_VECTOR);

Then i tried to set m_isRescued, but hostage dissapeared and didn't count as rescued.

PHP Code:
public Action:HostageFollows(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
hostage GetEventInt(event"hostage");
    new 
offs_hostagerescued FindSendPropOffs("CHostage""m_isRescued");
    
SetEntData(hostageoffs_hostagerescued1);

Also i tried to use CHostage.m_leader after teleport but it didn't work =(

PHP Code:
public Action:HostageFollows(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
hostage GetEventInt(event"hostage");
    
TeleportEntity(hostagef_ct_bzNULL_VECTORNULL_VECTOR);
    new 
Handle:pack CreateDataPack();
    
WritePackCell(packclient);
    
WritePackCell(packhostage);
    
CreateTimer(0.1InstantHostageRescuepack);
}

public 
Action:InstantHostageRescue(Handle:timerany:data)
{
    new 
Handle:pack data;
    
ResetPack(pack);
    new 
client ReadPackCell(pack);
    new 
hostage ReadPackCell(pack);
    
CloseHandle(pack);
    new 
offs_hostageleader FindSendPropOffs("CHostage""m_leader");
    
SetEntData(hostageoffs_hostageleaderclient);

I don't have ideas now. Will be glad for any help.

Thanks.

Last edited by Gugie; 11-26-2013 at 13:47.
Gugie is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 11-23-2013 , 08:59   Re: rescue hostage
Reply With Quote #2

Like talk to him and ask him to follow you all the way to rescue zone?
Or maybe he speak different languages that when he don't understand you well. Try hand signal instead.
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.
GsiX is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 11-23-2013 , 09:51   Re: rescue hostage
Reply With Quote #3

Find func_hostage_rescue and teleport hostage_entity in there
*edit
and there need to be also leader to hostage
*edit
how to hell get origin of hostage recue... ?

Last edited by Bacardi; 11-23-2013 at 10:11.
Bacardi is offline
Gugie
Member
Join Date: Jul 2012
Old 11-23-2013 , 10:29   Re: rescue hostage
Reply With Quote #4

well i can find ct base or just make array for every map with this ct rescue zone. It's not a problem. In my third example i tried to teleport hostage and make hostage's leader, but it didn't work. Hostage was in rescue zone tho =(

i did smthing wrong?

Last edited by Gugie; 11-23-2013 at 10:32.
Gugie is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 11-23-2013 , 11:08   Re: rescue hostage
Reply With Quote #5

hmm... it worked when hostage (or player) moved little bit before teleporting
*edit
it not need leader, but it need launch trigger "touch" in fun_hostage_rescue...

Last edited by Bacardi; 11-23-2013 at 11:30.
Bacardi is offline
Gugie
Member
Join Date: Jul 2012
Old 11-23-2013 , 11:41   Re: rescue hostage
Reply With Quote #6

Ow, ic. And how i can launch trigger "touch"?

Last edited by Gugie; 11-23-2013 at 11:43.
Gugie is offline
Gugie
Member
Join Date: Jul 2012
Old 11-23-2013 , 13:16   Re: rescue hostage
Reply With Quote #7

Well, that works, but it's rly bad way since i teleport player xD

PHP Code:
public Action:HostageFollows(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
hostage GetEventInt(event"hostage");
    if (
gb_SergeantGunnerHostage[client])
    {
        new 
Float:pos_client[3];
        
GetClientAbsOrigin(clientpos_client);
        
SetEntData(clientoffs_collision17);
        
SetEntData(hostageoffs_collision17);
        
TeleportEntity(hostagef_rescue_zoneNULL_VECTORNULL_VECTOR);
        
TeleportEntity(clientf_rescue_zoneNULL_VECTORNULL_VECTOR);
        
        new 
Handle:pack CreateDataPack();
        
WritePackCell(packclient);
        
WritePackFloat(packpos_client[0]);
        
WritePackFloat(packpos_client[1]);
        
WritePackFloat(packpos_client[2]);
        
CreateTimer(0.1InstantHostagepack);
    }
}

public 
Action:InstantHostage(Handle:timerany:data)
{
    new 
Handle:pack data;
    
ResetPack(pack);
    new 
client ReadPackCell(pack);
    new 
Float:pos_client[3];
    
pos_client[0] = ReadPackFloat(pack);
    
pos_client[1] = ReadPackFloat(pack);
    
pos_client[2] = ReadPackFloat(pack);
    
CloseHandle(pack);
    
TeleportEntity(clientpos_clientNULL_VECTORNULL_VECTOR);

I tried to create prop_dynamic_override and set collision to 17 but hostage just stayed inside prop. I prolly did smthing wrong haha. Maybe there are another solutions?

Thanks.

Last edited by Gugie; 11-24-2013 at 02:09.
Gugie is offline
Gugie
Member
Join Date: Jul 2012
Old 11-25-2013 , 05:34   Re: rescue hostage
Reply With Quote #8

There are no way to touch hostage but using player?

Last edited by Gugie; 11-25-2013 at 05:56.
Gugie is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 11-25-2013 , 06:28   Re: rescue hostage
Reply With Quote #9

Maybe you can try an ugly trick like... ummm..
Teleport all the hostage to the RZ..
Ask the hostage to calm and settle down..
Create a fake client (CT bot) and teleport him into the group.
Have them a lil coffee and chit chat while you waiting the message hostage rescued..
GsiX is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 11-25-2013 , 08:37   Re: rescue hostage
Reply With Quote #10

Do you have to touch the hostage or the rescue zone? The rescue zone has some inputs related to touch that you might be able to trigger.
bl4nk 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 13:14.


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