This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Block Trigger_hurt when start new round


Post New Thread Reply   
 
Thread Tools Display Modes
slLent
Member
Join Date: Apr 2010
Location: Tomsk, Russia
Old 10-10-2016 , 12:03   Re: Block Trigger_hurt when start new round
Reply With Quote #12

Quote:
Originally Posted by The Professional View Post
This not possible.. because we are don't admin.. and does not help my hosting. I need only plugin
Try this, but i'm not sure that it will cause another bug.
Spoiler
__________________

Last edited by slLent; 10-10-2016 at 12:08.
slLent is offline
The Professional
Member
Join Date: Nov 2015
Location: İstanbul
Old 10-13-2016 , 12:27   Re: Block Trigger_hurt when start new round
Reply With Quote #13

Quote:
Originally Posted by slLent View Post
Try this, but i'm not sure that it will cause another bug.
Spoiler
Thank you so much for help.. My problem is solved with my friend's plugin;

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#include <engine>
#include <fakemeta>

#define PLUGIN "zp_trigger_hurt_block"
#define VERSION "1.0"
#define AUTHOR "MSS"

const tlimit 32

new trig_id[tlimit// hurter ids
new trig_targets[tlimit][32// hurter targets
new trig_state[tlimit// hurter state (0 = off, 1 = on)
new numoftrigs 0

new Float:turnOffDelay 3.0 // Her sinyal geldiginde kac saniyeligine acik kalacak?
new Float:forbiddenDelay 20.0 // Round basinda ilk kac saniye trigger_hurt ile olmek imkansiz olacak?

new Float:lastRoundTime 0.0 // DOKUNMA

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event"HLTV""EventNewRound""a""1=0""2=0" )
    
RegisterHam(Ham_TakeDamage"player""player_damage")
    
register_forward(FM_AlertMessage"FireEvent"1)
    
    new 
temptext[64]
    new 
0
    
new entcount entity_count()
    for (new 
id 33id entcountid++)
    {
        if (!
is_valid_ent(id))
            continue;
        
entity_get_string(idEV_SZ_classnametemptext64)
        
//server_print(temptext)
        
if (equali(temptext"trigger_hurt"))
        {
            if (
entity_get_int(idEV_INT_spawnflags) & 2)
            {
                
                
//server_print("found")
                
trig_id[c] = id
                entity_get_string
(idEV_SZ_targetnametrig_targets[c], 32)
                
//server_print("target name = %s", trig_targets[c])
                
                //set_task(0.5, "spawnFlag", _, _, _, "b")
                
c++
                if (
>= tlimit)
                    break;
            }
        }
    }
    
numoftrigs c
    
    register_logevent
"EventRoundEnd"2"1=Round_End" )
    
//server_print("found %d hurters", c)
}


public 
TurnOffState(data[], id)
{
    
trig_state[data[0]] = 0
}

public 
FireEvent()
{
    new 
arg0[64]
    new 
comptxt[64]
    new 
param[1]
    for (new 
id 0id 64id++)
        
arg0[id] = getarg(1id)
    for (new 
id 0id numoftrigsid++)
    {
        
format(comptxtcharsmax(comptxt), "Firing: (%s)"trig_targets[id])
        if (
equal(arg0comptxtstrlen(comptxt)))
        {
            
//client_print(0, print_chat, "event: %s", arg0)
            
param[0] = id
            trig_state
[id] = 1
            set_task
(turnOffDelay"TurnOffState"_param1)
        }
    }
    return 
FMRES_IGNORED
}

public 
EventNewRound()
{
    for (new 
id 0id numoftrigsid++)
        
trig_state[id] = 0
    lastRoundTime 
get_gametime()
    
//set_task(OlusumGecikmesi, "spawnTriggers")
}

public 
EventRoundEnd()
{
    
/*new param[1]
    for (new id = 0; id < numoftrigs; id++)
    {
        param[0] = id
        set_task(turnOffDelay, "TurnOffState", _, param, 1)
    }*/
    //client_print(0, print_chat, "ROUND END")
}


public 
player_damage(thisidinflictoridattackerFloat:damagedamagebits) {
    for (new 
id 0id numoftrigsid++)
    {
        if(
idattacker == trig_id[id] && (!trig_state[id] || get_gametime() - lastRoundTime forbiddenDelay))
            return 
HAM_SUPERCEDE
    
}
    return 
HAM_IGNORED

__________________
The Professional 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 22:57.


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