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

[SOLVED] Prevent killings on end round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 10-22-2015 , 00:39   [SOLVED] Prevent killings on end round
Reply With Quote #1

hi guys i want plugin prevent killings on end round
i mean no one can kill anyone on end round
if i was in CT team and the round ended i can't kill anyone from T team

Last edited by arvEL.; 10-24-2015 at 12:09.
arvEL. is offline
Send a message via Skype™ to arvEL.
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-22-2015 , 02:29   Re: [Request] Prevent killings on end round
Reply With Quote #2

Just add the code to prevent damage recieve in Ham_TakeDamage forward.
zmd94 is offline
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 10-22-2015 , 03:36   Re: [Request] Prevent killings on end round
Reply With Quote #3

Quote:
Originally Posted by zmd94 View Post
Just add the code to prevent damage recieve in Ham_TakeDamage forward.
what the code?
can you give me full code to block damage on end round
arvEL. is offline
Send a message via Skype™ to arvEL.
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 10-22-2015 , 03:37   Re: [Request] Prevent killings on end round
Reply With Quote #4

in zombie plague i find this

PHP Code:
// Ham Take Damage Forward
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
// Non-player damage or self damage
if (victim == attacker || !is_user_valid_connected(attacker))
return 
HAM_IGNORED;

// New round starting or round ended
if (g_newround || g_endround)
return 
HAM_SUPERCEDE;

// Victim shouldn't take damage 
if (g_nodamage[victim])
return 
HAM_SUPERCEDE;

// Prevent friendly fire
if (g_zombie[attacker] == g_zombie[victim])
return 
HAM_SUPERCEDE;

// Attacker is human...
if (!g_zombie[attacker])
{
// Armor multiplier for the final damage on normal zombies
if (!g_nemesis[victim] && !g_assassin[victim] && !g_sniper[attacker])
{
damage *= get_pcvar_float(cvar_zombiearmor)
SetHamParamFloat(4damage)
}

// Reward ammo packs
if (!g_survivor[attacker] || !g_sniper[attacker])
{
// Store damage dealt
g_damagedealt[attacker] += floatround(damage)

// Reward ammo packs for every [ammo damage] dealt
while (g_damagedealt[attacker] > get_pcvar_num(cvar_ammodamage))
{
g_ammopacks[attacker]++
g_damagedealt[attacker] -= get_pcvar_num(cvar_ammodamage)
}
}

// Set sniper damage
if (g_sniper[attacker] && g_currentweapon[attacker] == CSW_AWP)
SetHamParamFloat(4get_pcvar_float(cvar_snidamage))

return 
HAM_IGNORED;
}

// Attacker is zombie...

// Prevent infection/damage by HE grenade (bugfix)
if (damage_type DMG_HEGRENADE)
return 
HAM_SUPERCEDE;

// Nemesis?
if (g_nemesis[attacker])
{
// Ignore nemesis damage override if damage comes from a 3rd party entity
// (to prevent this from affecting a sub-plugin's rockets e.g.)
if (inflictor == attacker)
{
// Set nemesis damage
SetHamParamFloat(4get_pcvar_float(cvar_nemdamage))
}

return 
HAM_IGNORED;
}
else if (
g_assassin[attacker])
{
// Ignore assassin damage override if damage comes from a 3rd party entity
// (to prevent this from affecting a sub-plugin's rockets e.g.)
if (inflictor == attacker)
{
// Set assassin damage
SetHamParamFloat(4get_pcvar_float(cvar_assadamage))
}

return 
HAM_IGNORED;
}

// Last human or not an infection round
if (g_nemround || g_assaround || g_survround || g_sniround || g_swarmround || g_plagueround || g_armaround || g_apocround || g_nightround || fnGetHumans() == 1)
return 
HAM_IGNORED// human is killed

// Does human armor need to be reduced before infecting?
if (get_pcvar_num(cvar_humanarmor))
{
// Get victim armor
static Float:armor
pev
(victimpev_armorvaluearmor)

// Block the attack if he has some
if (armor 0.0)
{
emit_sound(victimCHAN_BODYsound_armorhit1.0ATTN_NORM0PITCH_NORM)
set_pev(victimpev_armorvaluefloatmax(0.0armor damage))
return 
HAM_SUPERCEDE;
}
}

// Infection allowed
zombieme(victimattacker0001// turn into zombie
return HAM_SUPERCEDE;

arvEL. is offline
Send a message via Skype™ to arvEL.
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-22-2015 , 05:25   Re: [Request] Prevent killings on end round
Reply With Quote #5

Firstly, just add check if attacker is terrorist team and the victim is counter-terrorist team and vice versa. Next, just return HAM_SUPERCEDE.

Last edited by zmd94; 10-22-2015 at 05:25.
zmd94 is offline
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 10-22-2015 , 05:41   Re: [Request] Prevent killings on end round
Reply With Quote #6

Quote:
Originally Posted by zmd94 View Post
Firstly, just add check if attacker is terrorist team and the victim is counter-terrorist team and vice versa. Next, just return HAM_SUPERCEDE.
bro plz give me full code i'm bad in AMXX
arvEL. is offline
Send a message via Skype™ to arvEL.
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-22-2015 , 05:53   Re: [Request] Prevent killings on end round
Reply With Quote #7

Example:
PHP Code:
// We need this include
// If you already included it, no need to rewrite it again
#include <hamsandwich>

// Bool to detect round end
new bool:g_bRoundHasEnd

public plugin_init()
{
    
register_event("HLTV""NewRound""a""1=0""2=0")
    
register_logevent("RoundEnd"2"1=Round_End")
    
    
RegisterHam(Ham_TraceAttack"player""fw_TakeDamage")
}

public 
NewRound()
{
    
// Is new round
    
g_bRoundHasEnd false
}

public 
RoundEnd()
{
    
// Round has end
    
g_bRoundHasEnd true
}
    
// Ham Take Damage Forward
public fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    
// Round has end
    
if(g_bRoundHasEnd)
    {    
        
// If attacker and victim is not the same
        
if(attacker != victim)
        {
            return 
HAM_SUPERCEDE
        
}
    }
    
    return 
HAM_IGNORED


Last edited by zmd94; 10-22-2015 at 12:15.
zmd94 is offline
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 10-22-2015 , 10:38   Re: [Request] Prevent killings on end round
Reply With Quote #8

i will test wait me..
arvEL. is offline
Send a message via Skype™ to arvEL.
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 10-22-2015 , 11:09   Re: [Request] Prevent killings on end round
Reply With Quote #9

sorry not work :/
arvEL. is offline
Send a message via Skype™ to arvEL.
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-22-2015 , 12:06   Re: [Request] Prevent killings on end round
Reply With Quote #10

@zmd, you never register the fw_TakeDamage forward. Also the team check is useless.
__________________
HamletEagle 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 18:07.


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