Hns antifrag (o singura lovitura)

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
yahimyahim
Membru, skill 0
Membru, skill 0
Posts: 14
Joined: 28 May 2020, 20:40
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

12 Dec 2020, 11:48

Salut!. Vreau ca acest plugin sa se activeze doar la o singura,lovitura, indiferent de arma(deagle, knife).Nu cand dau 1 glont deagle sa se reactiveze automat cand dau lama.

Code: Select all

/*
	Plugin:		HNS AntiFrag
	Version:	1.1
	Author:		KoHb
	
	Plugin Thread:
	https://forums.alliedmods.net/showthread.php?t=301434
	
	Description:
	This plugin is special created for HNS (Hide and Seek) mod. It prevents seekers to frag hiders with knife double attack. When seeker hits hider his speed is changing to af_stop_speed (default: 100.0 units/sec) for af_stop_time (default: 4.0 sec) seconds. Plugin also prevents group attack on hider by blocking damage from others for af_stop_time after he got first hit.
	
	Cvars:
	af_stop_time - time in seconds how long slow down a seeker (default: 4.0 sec)
	af_stop_speed - set seeker speed in units when he is slowed down (default: 100.0 units/sec)
	
	Languages:
	English [en] - KoHb
	Polish [pl] - KoHb
	Russian [ru] - KoHb
	
	Installation:
	1. Compile it locally with attached ColorChat include (colorchat.inc goes to addons/amxmodx/scripting/include)
	2. Put hns_antifrag.amxx in addons/amxmodx/plugins folder
	3. Open your plugins.ini file from addons/amxmodx/configs and add hns_antifrag.amxx where you want
	4. Put hns_antifrag.txt in addons/amxmodx/data/lang
	5. Set CVARs if you want different in your server.cfg or amxx.cfg
	6. If you want freeze seeker instead of slowing him down set af_stop_speed 0.1
	
	Credits:
	OciXCrom - way to use HAM_SUPERCEDE taken from amxx-bg forum
	
	Changelog:
	[1.0]
	- Initial release
	[1.1]
	- Added ML support
	
	List to do:
	- maybe you suggest smth?
*/

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

#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif

#define PLUGIN "HNS AntiFrag"
#define VERSION "1.1"
#define AUTHOR "KoHb"

new g_iLastHit[33]
new cvar_times
new cvar_speed
new Float:times
new Float:speed

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	RegisterHam(Ham_TraceAttack, "player", "PrePlayerAttack",0)
	RegisterHam(Ham_TakeDamage, "player", "player_damage",1)
	cvar_times = register_cvar("af_stop_time","4.0")
	cvar_speed = register_cvar("af_stop_speed","100.0")
	register_dictionary("hns_antifrag.txt")
}

public client_putinserver(id)
{
	g_iLastHit[id] = 0
}

public PrePlayerAttack(victim, attacker, Float:damage)
{
	if(!is_user_connected(attacker) || victim == attacker || get_user_team(victim) != 1)
		return HAM_IGNORED
	
	return (get_systime() - g_iLastHit[victim] < times) ? HAM_SUPERCEDE : HAM_IGNORED
}

public player_damage(victim, weapon, attacker, Float:damage, bits)
{
	if(!is_user_connected(victim) || !is_user_connected(attacker) || victim == attacker || !is_user_alive(victim))
		return HAM_IGNORED
		
	if(get_user_team(attacker) == 2 && get_user_team(victim) == 1)
	{
		new vName[32], aName[32]
		get_user_name(attacker,aName,31)
		get_user_name(victim,vName,31)
		
		times = get_pcvar_float(cvar_times)
		speed = get_pcvar_float(cvar_speed)
		
		g_iLastHit[victim] = get_systime()
		
		set_user_rendering(victim, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 0)
		set_task(times,"cmdOffGlow",victim)
		
		engfunc(EngFunc_SetClientMaxspeed,attacker,speed)
		set_task(times,"cmdOffSlowspeed",attacker)
		
		ColorChat(attacker, RED,"^3[HNS]^1 %L^1!",attacker,"HNSAF_GIVE_NSEC_TO_RUN",get_pcvar_num(cvar_times),vName)
		ColorChat(victim, RED,"^3[HNS]^1 %L^1!",victim,"HNSAF_UHAVE_NSEC_TO_RUN",get_pcvar_num(cvar_times),aName)
	}
	return HAM_IGNORED
}

public client_disconnect(id)
{
	remove_task(id)
}

public cmdOffGlow(id)
{
	set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)
}

public cmdOffSlowspeed(id)
{
	engfunc(EngFunc_SetClientMaxspeed,id,250.0)
}
RoyalServer
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3844
Joined: 24 Aug 2011, 12:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 594 times
Contact:

12 Dec 2020, 17:37

ce face pluginu și ce vrei tu să facă mai exact?
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
yahimyahim
Membru, skill 0
Membru, skill 0
Posts: 14
Joined: 28 May 2020, 20:40
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

12 Dec 2020, 18:42

Acest plugin da o sansa jucatorior din echipa T cand primeste O lovitura de cutit,adica timp de cateva secunde nu mai poate primi damage.Pluginul functioneaza perfect dar eu am pus un plugin de arme si da 2 sanse la un jucator.Una cand ii dai un glont de arma si una cand ii dai o lovitura de cutit.

Nu vad de unde vine acest bug ca in plugin e trecut "weapons" deci orice arma .
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3844
Joined: 24 Aug 2011, 12:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 594 times
Contact:

13 Dec 2020, 14:10

inversează poziția cu ultimu plg pus care zici că face bugu
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
yahimyahim
Membru, skill 0
Membru, skill 0
Posts: 14
Joined: 28 May 2020, 20:40
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

13 Dec 2020, 14:51

N am ce sa inversez
--------------------------------------------------------------------
amx_showip.amxx ; SHOW IP ADDR
ping.amxx ; latency
bullet_damage.amxx
hidenseek.amxx
team_join.amxx
frostnades.amxx
allchat.amxx
allow_roundfinish.amxx
hide_knife.amxx
anti_jointeam.amxx
uq_jumpstats.amxx
uq_jumpstats_tops.amxx
hns_antifrag.amxx
revive.amxx
Hats_fixed.amxx
deagle.amxx
camera.amxx
specinfo.amxx
retry.amxx
Prestrafe_Shower.amxx
yahimyahim
Membru, skill 0
Membru, skill 0
Posts: 14
Joined: 28 May 2020, 20:40
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

13 Dec 2020, 20:59

bubui de prost si nu imi pot rezolva singur o problema
Last edited by trekA on 14 Dec 2020, 21:19, edited 1 time in total.
Reason: Warn pentru off topic și comportament de superior.
User avatar
Laurentiu P.
Fost moderator
Fost moderator
Posts: 2548
Joined: 10 Jul 2013, 21:26
Detinator Steam: Da
Reputatie: Fost super moderator
Fond eXtream: 100
Has thanked: 26 times
Been thanked: 61 times
Contact:

14 Dec 2020, 20:19

yahimyahim wrote:
14 Dec 2020, 15:47
Nu aveți potential
Nu ti se pare ca esti cam nesimitit ? Daca tot nu avem "potential" rezolvati singur problema.
no...
yahimyahim
Membru, skill 0
Membru, skill 0
Posts: 14
Joined: 28 May 2020, 20:40
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

15 Dec 2020, 08:55

Sunteți slabi.
Last edited by trekA on 15 Dec 2020, 09:11, edited 1 time in total.
Reason: Warn pentru off topic și comportament de superior x2. Next primesti ban.
User avatar
LNd #
Membru, skill +1
Membru, skill +1
Posts: 126
Joined: 07 Sep 2017, 23:33
Detinator Steam: Da
SteamID: eXeDLL [1337]
Fond eXtream: 0
Has thanked: 3 times
Been thanked: 9 times

15 Dec 2020, 11:43

adica odata pe runda sa ai acea sansa? faci un bool , si il pui true cand primeste lovitura. pui in if daca bool ul e true sa dea HAM_IGNORED.. si la inceput de runda il resetezi...

Code: Select all

/*
	Plugin:		HNS AntiFrag
	Version:	1.1
	Author:		KoHb
	
	Plugin Thread:
	https://forums.alliedmods.net/showthread.php?t=301434
	
	Description:
	This plugin is special created for HNS (Hide and Seek) mod. It prevents seekers to frag hiders with knife double attack. When seeker hits hider his speed is changing to af_stop_speed (default: 100.0 units/sec) for af_stop_time (default: 4.0 sec) seconds. Plugin also prevents group attack on hider by blocking damage from others for af_stop_time after he got first hit.
	
	Cvars:
	af_stop_time - time in seconds how long slow down a seeker (default: 4.0 sec)
	af_stop_speed - set seeker speed in units when he is slowed down (default: 100.0 units/sec)
	
	Languages:
	English [en] - KoHb
	Polish [pl] - KoHb
	Russian [ru] - KoHb
	
	Installation:
	1. Compile it locally with attached ColorChat include (colorchat.inc goes to addons/amxmodx/scripting/include)
	2. Put hns_antifrag.amxx in addons/amxmodx/plugins folder
	3. Open your plugins.ini file from addons/amxmodx/configs and add hns_antifrag.amxx where you want
	4. Put hns_antifrag.txt in addons/amxmodx/data/lang
	5. Set CVARs if you want different in your server.cfg or amxx.cfg
	6. If you want freeze seeker instead of slowing him down set af_stop_speed 0.1
	
	Credits:
	OciXCrom - way to use HAM_SUPERCEDE taken from amxx-bg forum
	
	Changelog:
	[1.0]
	- Initial release
	[1.1]
	- Added ML support
	
	List to do:
	- maybe you suggest smth?
*/

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

#if AMXX_VERSION_NUM < 183
#include <colorchat>
#endif

#define PLUGIN "HNS AntiFrag"
#define VERSION "1.1"
#define AUTHOR "KoHb"

new g_iLastHit[33]
new cvar_times
new cvar_speed
new Float:times
new Float:speed

new bool:hit[33];

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	RegisterHam(Ham_TraceAttack, "player", "PrePlayerAttack",0)
	RegisterHam(Ham_TakeDamage, "player", "player_damage",1)
	RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1) 
	cvar_times = register_cvar("af_stop_time","4.0")
	cvar_speed = register_cvar("af_stop_speed","100.0")
	register_dictionary("hns_antifrag.txt")
}

public client_putinserver(id)
{
	g_iLastHit[id] = 0
	hit[id] = false;
}

public fwHamPlayerSpawnPost(id)
	hit[id] = false;

public PrePlayerAttack(victim, attacker, Float:damage)
{
	if(!is_user_connected(attacker) || victim == attacker || get_user_team(victim) != 1 || hit[victim])
		return HAM_IGNORED
	
	return (get_systime() - g_iLastHit[victim] < times) ? HAM_SUPERCEDE : HAM_IGNORED
}

public player_damage(victim, weapon, attacker, Float:damage, bits)
{
	if(!is_user_connected(victim) || !is_user_connected(attacker) || victim == attacker || !is_user_alive(victim) || hit[victim])
		return HAM_IGNORED
		
	if(get_user_team(attacker) == 2 && get_user_team(victim) == 1)
	{
		new vName[32], aName[32]
		get_user_name(attacker,aName,31)
		get_user_name(victim,vName,31)
		
		times = get_pcvar_float(cvar_times)
		speed = get_pcvar_float(cvar_speed)
		
		g_iLastHit[victim] = get_systime()
		
		set_user_rendering(victim, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 0)
		set_task(times,"cmdOffGlow",victim)
		
		engfunc(EngFunc_SetClientMaxspeed,attacker,speed)
		set_task(times,"cmdOffSlowspeed",attacker)
		
		ColorChat(attacker, RED,"^3[HNS]^1 %L^1!",attacker,"HNSAF_GIVE_NSEC_TO_RUN",get_pcvar_num(cvar_times),vName)
		ColorChat(victim, RED,"^3[HNS]^1 %L^1!",victim,"HNSAF_UHAVE_NSEC_TO_RUN",get_pcvar_num(cvar_times),aName)

		hit[victim] = true;
	}
	return HAM_IGNORED
}

public client_disconnect(id)
{
	remove_task(id)
	hit[id] = false;
}

public cmdOffGlow(id)
{
	set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)
}

public cmdOffSlowspeed(id)
{
	engfunc(EngFunc_SetClientMaxspeed,id,250.0)
}
nu am testat
Legends never die
aqualow
Membru, skill 0
Membru, skill 0
Posts: 8
Joined: 23 Dec 2020, 18:23
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

27 Dec 2020, 16:54

NU functioneaza !
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests