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

[REQ] Plugin that stop players from killing each other


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mina Falcon
Junior Member
Join Date: Feb 2018
Location: Egypt
Old 03-14-2018 , 00:06   [REQ] Plugin that stop players from killing each other
Reply With Quote #1

Hello Guys

Is there a way to prevent players from killing each other after the end of the round?

Because this is very annoying when round is end and then receive your death whether you are a winner or a loser

Thanks in advance
Mina Falcon is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 03-14-2018 , 00:51   Re: [REQ] Plugin that stop players from killing each other
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <hamsandwich>

new MAXPLAYERS

new bool:g_bAttack[33] = {true, ...}

public 
plugin_init() 
{
    
RegisterHam(Ham_TakeDamage"player""onTakeDamagePre"false)
    
RegisterHam(Ham_TraceAttack"player""onTraceAttack")
    
register_event("HLTV""EventRoundStart""a""1=0""2=0")
    
register_event("TextMsg""EventRoundEnd""a""2&#Game_C""2&#Game_w");
    
register_event("SendAudio","EventRoundEnd","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
    
MAXPLAYERS get_maxplayers();
}

public 
onTakeDamagePre(victiminflictorattackerFloat:dmgdmgbits)
{
    if(!
is_user_alive(attacker) || get_user_team(attacker) == get_user_team(victim))
        return 
HAM_IGNORED
    
    
return g_bAttack[attacker] ? HAM_IGNORED HAM_SUPERCEDE
}

public 
onTraceAttack(entattackerFloat:damageFloat:direction[3], tracedmgbits)
    return !
g_bAttack[attacker] ? HAM_SUPERCEDE HAM_IGNORED


public EventRoundStart()
{
    for(new 
id;id MAXPLAYERS;id++)
    {
        if(
is_user_connected(id))
        {
            
g_bAttack[id] = true
        
}
    }
}


public 
EventRoundEnd()
{
    for(new 
id;id MAXPLAYERS;id++)
    {
        if(
is_user_connected(id))
        {
            
g_bAttack[id] = false
        
}
    }


Last edited by raizo11; 03-17-2018 at 03:15.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 03-14-2018 , 03:19   Re: [REQ] Plugin that stop players from killing each other
Reply With Quote #3

I'm not a coder, but would simply setting mp_friendlyfire to 0 do the same, without all these checks?
__________________

Mordekay is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 03-14-2018 , 08:02   Re: [REQ] Plugin that stop players from killing each other
Reply With Quote #4

Quote:
Originally Posted by Mordekay View Post
I'm not a coder, but would simply setting mp_friendlyfire to 0 do the same, without all these checks?
This isn't even related with what he asked !!

If you are using REGAMEDLL then it has this feature :
Code:
mp_round_restart_delay

Last edited by instinctpt1; 03-14-2018 at 08:04.
instinctpt1 is offline
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 03-14-2018 , 10:18   Re: [REQ] Plugin that stop players from killing each other
Reply With Quote #5

Quote:
Originally Posted by instinctpt1 View Post
This isn't even related with what he asked !!
Yes, you are right. I thought he meant only death through teammates.
__________________

Mordekay is offline
Mina Falcon
Junior Member
Join Date: Feb 2018
Location: Egypt
Old 03-14-2018 , 13:33   Re: [REQ] Plugin that stop players from killing each other
Reply With Quote #6

No No Guys, If you notice that when the round is over you still can kill any player from the other team and they too still can kill you i,m not talking about friendly fire or any thing about teammates :"
Mina Falcon is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 03-14-2018 , 13:36   Re: [REQ] Plugin that stop players from killing each other
Reply With Quote #7

Quote:
Originally Posted by Mina Falcon View Post
No No Guys, If you notice that when the round is over you still can kill any player from the other team and they too still can kill you i,m not talking about friendly fire or any thing about teammates :"
We know brother what you want
Look what i said above ..
If u are using REGAMEDLL you can do that easily

And if not then can stop the damage itself by this :
PHP Code:
#include <amxmodx>
#include <hamsandwich>

new HamHook:hNoDamage

public plugin_init()
{
    
register_plugin("End round no kills""0.0.1""wbyokomo")
    
    
hNoDamage RegisterHam(Ham_TakeDamage"player""OnTakeDamage"0)
    
DisableHamForward(hNoDamage)
    
    
register_event("HLTV""OnNewRound""a""1=0""2=0")
    
register_logevent("OnEndRound"2"1=Round_End")
}

public 
OnNewRound()
{
    
DisableHamForward(hNoDamage)
}

public 
OnEndRound()
{
    
EnableHamForward(hNoDamage)
}

public 
OnTakeDamage(vicinfatkFloat:dmgdmgbit)
{
    return 
HAM_SUPERCEDE;


Last edited by instinctpt1; 03-14-2018 at 13:40.
instinctpt1 is offline
Mina Falcon
Junior Member
Join Date: Feb 2018
Location: Egypt
Old 03-14-2018 , 13:45   Re: [REQ] Plugin that stop players from killing each other
Reply With Quote #8

Thx bro, i will try it right now <3
Mina Falcon is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 03-14-2018 , 14:20   Re: [REQ] Plugin that stop players from killing each other
Reply With Quote #9

Hmm now add prefix SOLVED in title
instinctpt1 is offline
Mina Falcon
Junior Member
Join Date: Feb 2018
Location: Egypt
Old 03-16-2018 , 00:34   Re: [REQ] Plugin that stop players from killing each other
Reply With Quote #10

that's still not working they still kill each other after the countdown is end
Mina Falcon is offline
Old 03-16-2018, 00:39
instinctpt1
This message has been deleted by instinctpt1. Reason: wrong thread
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:06.


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