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

Zombie escape zone problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vitality5
Junior Member
Join Date: Dec 2016
Location: Turkey
Old 12-04-2016 , 12:29   Zombie escape zone problem
Reply With Quote #1

Hi, guys. I'm sorry for I used bad english. Anyway, My problem is escape zone in map. I don't know how to catch escape zone in map. I am looking for code to catch the explosion moment because zombie and human survive the round does not end. I want to kill the team with few players after the explosion. Can you help me?

Last edited by vitality5; 12-04-2016 at 12:37.
vitality5 is offline
vitality5
Junior Member
Join Date: Dec 2016
Location: Turkey
Old 12-11-2016 , 10:46   Re: Zombie escape zone problem
Reply With Quote #2

help please
vitality5 is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 12-12-2016 , 02:01   Re: Zombie escape zone problem
Reply With Quote #3

Try this. You can get the Ham bots api from the official Zombie Plague thread or you can remove support for them.

Code:
// Modules #include <amxmodx> #include <engine> #include <hamsandwich> // Plug-in APIs #include <cs_ham_bots_api> new g_iMaxPlayers; public plugin_init() {     register_plugin("D7 damage changer trigger_hurt", "0.0.1", "D i 5 7 i n c T")         RegisterHam(Ham_TakeDamage, "player", "fwHamTakeDamagePlayerPre")     RegisterHamBots(Ham_TakeDamage, "fwHamTakeDamagePlayerPre")         g_iMaxPlayers = get_maxplayers(); } public fwHamTakeDamagePlayerPre(const iIDVictim, const iIDInflictor, const iIDAttacker, Float:fDamage)//, const iBsDamageType {     if (fDamage < 100.0 || (1 <= iIDAttacker <= g_iMaxPlayers) || !is_valid_ent(iIDAttacker))         return HAM_IGNORED;         static szEntClassName[32];     entity_get_string(iIDAttacker, EV_SZ_classname, szEntClassName, charsmax(szEntClassName))         if (!equali(szEntClassName, "trigger_hurt"))         return HAM_IGNORED;         fDamage = 1000000.0;         SetHamParamFloat(4, fDamage)         return HAM_HANDLED; }
Attached Files
File Type: sma Get Plugin or Get Source (D7DamageChangerTriggerHurt.sma - 495 views - 962 Bytes)
__________________

Last edited by georgik57; 12-12-2016 at 02:01.
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
vitality5
Junior Member
Join Date: Dec 2016
Location: Turkey
Old 12-17-2016 , 20:04   Re: Zombie escape zone problem
Reply With Quote #4

Unfortunately, it's not working. I think you misunderstand. Now, I have a ze_ extension map and the helicopter set down when the explosion takes place. I want code to find the moment of explosion.
I'll use this code to kill those who survived the explosion
vitality5 is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 12-18-2016 , 14:53   Re: Zombie escape zone problem
Reply With Quote #5

The "explosion" is a trigger_hurt entity that does damage to the player.
Your players aren't dying because it isn't doing enough damage, so this script changes that damage to 1,000,000(which I think is enough to kill any player).
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-18-2016 , 17:31   Re: Zombie escape zone problem
Reply With Quote #6

Quote:
Originally Posted by georgik57 View Post
The "explosion" is a trigger_hurt entity that does damage to the player.
Your players aren't dying because it isn't doing enough damage, so this script changes that damage to 1,000,000(which I think is enough to kill any player).
What about the explosion radius?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 12-19-2016 , 03:36   Re: Zombie escape zone problem
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
What about the explosion radius?
No such thing. There are map zones which are affected by it and zones which are not.
If some zone is not covered by a trigger_hurt entity, but should be, then it's the map's fault.
I can't think of an efficient way to fix that rather than fixing the actual map.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
vitality5
Junior Member
Join Date: Dec 2016
Location: Turkey
Old 12-19-2016 , 08:03   Re: Zombie escape zone problem
Reply With Quote #8

Quote:
Originally Posted by georgik57 View Post
The "explosion" is a trigger_hurt entity that does damage to the player.
Your players aren't dying because it isn't doing enough damage, so this script changes that damage to 1,000,000(which I think is enough to kill any player).
but zombies and people can be in helicopter at the moment of explosion. The players inside are not dying so the game is not end. I want to win more teams. The team with fewer players will automatically die.
vitality5 is offline
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 09-07-2021 , 18:28   Re: Zombie escape zone problem
Reply With Quote #9

Hi I know this is an old topic
But I have this problem too
Anyone have a solution?
__________________
amirwolf is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 09-07-2021 , 22:07   Re: Zombie escape zone problem
Reply With Quote #10

NOTE: For who just plan to copy and use this code: This is for study purpose so you might need to add/remove stuff to make this work depend on what you need.

I found this post by the mod at escape-zone to be quite useful
Sauce: https://escapers-zone.net/viewtopic.php?t=3459

The problem is, each map have different way to trigger the final trigger_hurt so we have to fine all the possible way to hook it to execute team kill at that moment.

Quote:
Originally Posted by Raheem
So let's discuss possible ways:
  1. Touching trigger_hurt with High Damage
  2. If player touching trigger_multiple and touching the moving entity
  3. We can combine the 1, 2 in one plugin, to make somehow general idea
PHP Code:
/*
*   This will hook the trigger_hurt when it's activated.
*   What i know is that trigger_hurt can be activated via button or trigger_multiple
*   This method is good for maps that conatin trains..etc
*   Also we will hook which using trigger_multiple only
*
*   If user is touching the train and this player touched trigger_multiple then the trigger_hurt will be called.
*   In fact the trigger_hurt will be called once trigger_multiple is touched by player but we will tie it with train also. Away to avoid hardcode every map.
*/
 
#include "zombie_escape.inc"
 
#define MIN_DAMAGE 9000
 
// Add all moving entities
new const g_szEntities[][] =
{
    
"func_tracktrain",
    
"func_vehicle"
}
 
new 
Float:g_flLastTouched[33], g_iMaxPlayersbool:g_bCalledg_iTriggerHurtForward
 
public plugin_init()
{
    
register_plugin("Hook Trigger Hurt""1.0""Raheem")
   
    for(new 
iEnt 0iEnt <= charsmax(g_szEntities); iEnt++)
    {
        
RegisterHam(Ham_Touchg_szEntities[iEnt], "Fw_TouchMoving_Pre"0)
    }
   
    
RegisterHam(Ham_Touch"trigger_multiple""Fw_TouchTriggerMultiple_Pre"0)
   
    
// Here we register touching any trigger_hurt
    
RegisterHam(Ham_Touch"trigger_hurt""Fw_TouchTrigger_Post"1)
   
    
g_iMaxPlayers get_member_game(m_nMaxPlayers)
   
    
g_iTriggerHurtForward CreateMultiForward("trigger_hurt"ET_IGNORE)
}
 
public 
ze_game_started()
{
    
g_bCalled false
}
 
public 
Fw_TouchTriggerMultiple_Pre(iEntid)
{
    
// Here player touching trigger_multiple
    // Let's check first if he is touching also the train or not
    
if (TouchingMovingVehicle())
    {
        
// Player in vehicle and he touched trigger_multiple
        
if (!g_bCalled)
        {
            
// Here we execute our forward
            
ExecuteForward(g_iTriggerHurtForward)
            
g_bCalled true
        
}
    }
}
 
public 
Fw_TouchTrigger_Post(iEntid)
{
    if(!
is_user_alive(id) || !pev_valid(iEnt))
        return 
HAM_IGNORED
   
    
if (pev(iEntpev_dmg) > MIN_DAMAGE)
    {
        if (!
g_bCalled)
        {
            
ExecuteForward(g_iTriggerHurtForward)
            
g_bCalled true
        
}
    }
 
    return 
HAM_IGNORED
}
 
public 
Fw_TouchMoving_Pre(iEntid)
{
    if (!
is_user_connected(id))
        return 
HAM_IGNORED;
   
    
g_flLastTouched[id] = get_gametime()
   
    return 
HAM_IGNORED;
}
 
stock TouchingMovingVehicle()
{
    
// Check if anyone touching our moving trians or not
    
for(new id 1id <= g_iMaxPlayersid++)
    {
        if (!
is_user_alive(id))
            continue;
       
        if (
g_flLastTouched[id] + 0.1 >= get_gametime()) /* For more accurecy lower 0.1 to for example 0.01*/
        
{
            return 
true;
        }
    }
   
    return 
false;


Quote:
Originally Posted by Raheem
Why i need to listen to this event?
  • Maybe it's useful in some cases. and you maybe need to make somethings when it's called or after it's called.
    Basacilly i thought in this because i was trying to write a code that if some zombies not died with this trigger_hurt at the round end then i'll give them a chance 20 seconds to try if they failed i'll slay them. I must know how to hook the final trigger_hurt in order we can give him the chance and do all our code.
__________________
My plugin:

Last edited by Celena Luna; 09-07-2021 at 22:10.
Celena Luna 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 19:36.


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