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

Instant Hostage Rescue v1.2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 09-02-2009 , 10:52   Instant Hostage Rescue v1.2
Reply With Quote #1

Instant Hostage Rescue v1.2

Description beginning
Imagine you are playing cs_italy, killed the last terrorist defending the base and waiting for your victory. No! There's one more terrorist camping somewhere! Now you have to rescue the hostages and spend two boring minutes walking again across the hole map...

Description
Hostages aren't anymore needed to be taken to the rescue zone. As CT when you aim a hostage and press e the hostage gets automatically rescued. This way terrorists have to really defend their base and hostages instead of start rushing to CT base or go camping elsewhere.

Installing
- Fakemeta and Hamsandwich modules are required.

Plugin was tested on Counter Strike, Condition Zero, dedicated server and listen server.
Attached Files
File Type: sma Get Plugin or Get Source (instant_hostage_rescue.sma - 816 views - 1.2 KB)

Last edited by SnoW; 09-03-2009 at 14:59.
SnoW is offline
Send a message via MSN to SnoW
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 09-02-2009 , 10:59   Re: Instant Hostage Rescue v1.0
Reply With Quote #2

Nice idea. This will sure make the gameplay more dynamic.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 09-02-2009 , 11:12   Re: Instant Hostage Rescue v1.0
Reply With Quote #3

What about storing save zone id in global variable and fake touch it from hostie ?

And you can remove is_entity_player( id ), since youre checking is_user_alive in next check

The save zone can be also func_hostage_rescue
__________________
xPaw is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 09-02-2009 , 11:17   Re: Instant Hostage Rescue v1.0
Reply With Quote #4

I think it will be better like this

PHP Code:
/* 
* AMX Mod X v1.8.1 plugin
*    Instant Hostage Rescue
*
* (c) Copyright 2009 by SnoW
*
* This file is provided as is (no warranties)
*
*/

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN "Instant Hostage Rescue"
#define VERSION "1.0"
#define AUTHOR "SnoW"

#define is_entity_player(%1) (0<%1<=gMaxPlayers)

new gMaxPlayers;
new 
gHostageClassName[ ] = "hostage_entity";
new 
gHostageClassName2[ ] = "monster_scientist";
new 
gRescueAreaClassName[ ] = "info_hostage_rescue";

new 
Float:gAreaOrigin[3]

public 
plugin_init( )
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
    new 
area engfuncEngFunc_FindEntityByString, -1"classname"gRescueAreaClassName )
    
    if(
area)
    {
        
pevareapev_origingAreaOrigin );
    
        
RegisterHamHam_UsegHostageClassName"hamUseHostageEntity" );
        
RegisterHamHam_UsegHostageClassName2"hamUseHostageEntity" );
        
gMaxPlayers get_maxplayers( );
    }
}

public 
hamUseHostageEntityhostageid )
{
    if( 
is_entity_playerid ) && is_user_aliveid ) && get_user_teamid ) == /* CT */ )
    {
        
set_pevhostagepev_origingAreaOrigin );
        
        return 
HAM_HANDLED;
    }
    return 
HAM_IGNORED;

or

PHP Code:
/* 
* AMX Mod X v1.8.1 plugin
*    Instant Hostage Rescue
*
* (c) Copyright 2009 by SnoW
*
* This file is provided as is (no warranties)
*
*/

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN "Instant Hostage Rescue"
#define VERSION "1.0"
#define AUTHOR "SnoW"

#define is_entity_player(%1) (0<%1<=gMaxPlayers)

new gMaxPlayers;
new 
gHostageClassName[ ] = "hostage_entity";
new 
gHostageClassName2[ ] = "monster_scientist";
new 
gRescueAreaClassName[ ] = "info_hostage_rescue";

new 
Area

public plugin_init( )
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
    
Area engfuncEngFunc_FindEntityByString, -1"classname"gRescueAreaClassName )
    
    if(
Area)
    {
        
RegisterHamHam_UsegHostageClassName"hamUseHostageEntity" );
        
RegisterHamHam_UsegHostageClassName2"hamUseHostageEntity" );
        
gMaxPlayers get_maxplayers( );
    }
}

public 
hamUseHostageEntityhostageid )
{
    if( 
is_entity_playerid ) && is_user_aliveid ) && get_user_teamid ) == /* CT */ )
    {
        
dllfunc(DLLFunc_TouchArea hostage)
        return 
HAM_HANDLED;
    }
    return 
HAM_IGNORED;

__________________
joaquimandrade is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 09-02-2009 , 11:32   Re: Instant Hostage Rescue v1.0
Reply With Quote #5

Quote:
Originally Posted by ot_207 View Post
Nice idea. This will sure make the gameplay more dynamic.
Thank you Otty.
Quote:
Originally Posted by xPaw View Post
What about storing save zone id in global variable and fake touch it from hostie ?
I didn't store the origin or entity so this is compatible with other plugins. So they are able to move the rescue zone or what ever. Maybe I should think if that is still needed.
I'vent searched how the hostage rescuing is actually handled, but the thing I noticed at least was that fake touch doesn't work at all.
Quote:
Originally Posted by xPaw View Post
And you can remove is_entity_player( id ), since youre checking is_user_alive in next check
It's more optimized to check it like that without straight module call. Somehow now that I think, is there a possibility that some other entity uses hostage than player entity?
Quote:
Originally Posted by xPaw View Post
The save zone can be also func_hostage_rescue
What I read was that the info ent must be for rescuing zone, but func_hostage_rescue is only recommended and not actually needed. I don't know anything about mapping, but if there's more corrections for this they are more than welcomed.
Quote:
Originally Posted by joaquimandrade View Post
I think it will be better like this
I believe I explained already to xPaw why the plugins is as it is.

Thanks backup guys!

Last edited by SnoW; 09-02-2009 at 11:35.
SnoW is offline
Send a message via MSN to SnoW
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 09-02-2009 , 11:57   Re: Instant Hostage Rescue v1.0
Reply With Quote #6

Also, some maps dont have rescue zones, so hostages are rescuing in player spawns... there should be better way than setting origin to rescue zone lol
__________________
xPaw is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 09-02-2009 , 12:01   Re: Instant Hostage Rescue v1.0
Reply With Quote #7

<3 it
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 09-02-2009 , 12:56   Re: Instant Hostage Rescue v1.0
Reply With Quote #8

Quote:
Originally Posted by xPaw View Post
Also, some maps dont have rescue zones, so hostages are rescuing in player spawns... there should be better way than setting origin to rescue zone lol
Plugins can't support all custom maps. I think it's the mapper's fault and I shouldn't do his job if he can't build a map correctly. Thought after setting the origin, I could check if the hostage entity exist still, if it does set it origins to player spawn ones.
I think it's an awesome method.
Quote:
Originally Posted by crazyeffect View Post
<3 it
Thanks, Crazeff.
SnoW is offline
Send a message via MSN to SnoW
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 09-02-2009 , 12:57   Re: Instant Hostage Rescue v1.0
Reply With Quote #9

crazeff
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 09-02-2009 , 13:00   Re: Instant Hostage Rescue v1.0
Reply With Quote #10

Nice idea... i don't like cs_ maps but well... is a good plugin for ppl that usually play on that maps...

Also, you give me nice ideas for making a new plugin.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
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 01:42.


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