[esf 1.2.3] block advance melee and throw?

indeed
✔️ HL Verified
Discord Member
Joined
Oct 11, 2011
Messages
34
Best answers
0
I want to know if there's a way to block the advance melee in esf 1.2.3...
(amx function or a thing like that...)
Some pdata to know?

Example: For inmunity set_pdata_int(id,301,1) <-

Block = You can't use advance melee, you fly to the player (with melee weapon) and nothing happens (unless you use basic melee).
Thanks
 
Last edited:
NOT IN THE MANGA™
★ Black Lounger ★
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Jan 5, 2008
Messages
3,276
Best answers
0
Location
Lithuania
I've attempted to make this several times. The most reliable method is to simply force players to always have +attack2 pressed, but then they sometimes hit a player accidently. To perfectly disable advanced melee, I had made this more complex plugin, which I don't even think works perfectly (I believe there were some issues with displaying crosshair). Be my guest to test it out yourself.
PHP:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>

#define SetPlayerBit(%1,%2) (%1 |= (1 << (%2 & 31)))
#define ResetPlayerBit(%1,%2) (%1 &= ~(1 << (%2 & 31)))
#define GetPlayerBit(%1,%2) (%1 & (1 << (%2 & 31)))

#define SetWeaponId(%1,%2) set_pdata_int(%1, 30, %2, 4)

#define CLASS_TRUNKS 7

enum
{
	WEAPON_NONE,
	WEAPON_MELEE,
	WEAPON_SWORD
};

new Alive;
new InMelee;
new Attacking;
new Trunks;
new Entity[33];

public plugin_init()
{
	register_plugin("No Advanced Melee", "1.2", "hleV");
	
	register_event("CurWeapon", "OnCurWeapon", "be", "1=1");

	RegisterHam(Ham_Spawn, "player", "OnSpawn", 1);
	RegisterHam(Ham_Killed, "player", "OnKilled", 1);
	RegisterHam(Ham_Item_AddToPlayer, "weapon_melee", "OnAddToPlayer", 1);
	RegisterHam(Ham_Item_Deploy, "weapon_melee", "OnDeploy", 1);
}

public client_PreThink(client)
{
	if (!GetPlayerBit(Alive, client) || !GetPlayerBit(InMelee, client))
		return;
	
	if (entity_get_int(client, EV_INT_button) & IN_ATTACK2)
	{
		if (!GetPlayerBit(Attacking, client))
		{
			SetPlayerBit(Attacking, client);
			SetWeaponId(Entity[client], GetPlayerBit(Trunks, client) ? WEAPON_SWORD : WEAPON_MELEE);
		}
	}
	else if (GetPlayerBit(Attacking, client))
	{
		ResetPlayerBit(Attacking, client);
		SetWeaponId(Entity[client], WEAPON_NONE);
	}
}

public OnCurWeapon(client)
{
	if (read_data(2) > WEAPON_SWORD)
	{
		ResetPlayerBit(InMelee, client);
		
		return;
	}
	
	SetPlayerBit(InMelee, client);
	
	if (entity_get_int(client, EV_INT_button) & IN_ATTACK2)
		ResetPlayerBit(Attacking, client);
	else
		SetPlayerBit(Attacking, client);
}

public OnSpawn(client)
{
	if (!is_user_alive(client))
	{
		ResetPlayerBit(Alive, client);
		
		return;
	}
	
	SetPlayerBit(Alive, client);
	ResetPlayerBit(InMelee, client);
	
	get_user_team(client) == CLASS_TRUNKS ? SetPlayerBit(Trunks, client) : ResetPlayerBit(Trunks, client);
}

public OnKilled(victim)
	if (!is_user_alive(victim))
		ResetPlayerBit(Alive, victim);

public OnAddToPlayer(entity, client)
	Entity[client] = entity;

public OnDeploy(entity)
	SetWeaponId(entity, GetPlayerBit(Trunks, entity_get_edict(entity, EV_ENT_owner)) ? WEAPON_SWORD : WEAPON_MELEE);
Paste this here.
PHP:
#include <amxmodx>
#include <engine>
#include <hamsandwich>

#define SetPlayerBit(%0,%1) (%0 |= (1 << (%1 & 31)))
#define ResetPlayerBit(%0,%1) (%0 &= ~(1 << (%1 & 31)))
#define GetPlayerBit(%0,%1) (%0 & (1 << (%1 & 31)))

new Alive;

public plugin_init()
{
	register_plugin("Basic Melee", "1.1", "hleV");
	
	register_clcmd("spectate", "OnSpectate");

	RegisterHam(Ham_Spawn, "player", "OnSpawn", 1);
	RegisterHam(Ham_Killed, "player", "OnKilled", 1);
}

public client_PreThink(id)
	if (GetPlayerBit(Alive, id))
		entity_set_int(id, EV_INT_button, entity_get_int(id, EV_INT_button) | IN_ATTACK2);

public OnSpectate(id)
{
	engclient_cmd(id, "spectate");
	OnSpawn(id);
	
	return PLUGIN_HANDLED_MAIN;
}
	
public OnSpawn(id)
	is_user_alive(id) ? SetPlayerBit(Alive, id) : ResetPlayerBit(Alive, id);

public OnKilled(id)
	if (!is_user_alive(id))
		ResetPlayerBit(Alive, id);
 
Freelance Mappzor
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Nov 21, 2003
Messages
17,065
Best answers
0
Location
Stairing at the Abyss
mp_simplemeele 1 in to the console does that trick.

No need for AMXX
 
NOT IN THE MANGA™
★ Black Lounger ★
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Jan 5, 2008
Messages
3,276
Best answers
0
Location
Lithuania
You obviously never tried that CVAR. It screws up basic melee bad.
 
indeed
✔️ HL Verified
Discord Member
Joined
Oct 11, 2011
Messages
34
Best answers
0
Thanks !

mp_simplemeele 1 do what i want but make over power the basic melee o_O.
It's seems to be a float var, but putting 0.1 don't change the bug..

I will try the plugin, thxs...

---
 
Freelance Mappzor
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Nov 21, 2003
Messages
17,065
Best answers
0
Location
Stairing at the Abyss
You obviously never tried that CVAR. It screws up basic melee bad.
It increases the blowback to about half of what it was in 1.1 Its still possible to land a 2 hit combo, but you need to get the timing perfect. So how does that screw it up?
 
NOT IN THE MANGA™
★ Black Lounger ★
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Jan 5, 2008
Messages
3,276
Best answers
0
Location
Lithuania
By increasing the blowback. The OP was asking for a solution to remove advanced melee, not alter basic melee.
 
Freelance Mappzor
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Nov 21, 2003
Messages
17,065
Best answers
0
Location
Stairing at the Abyss
Still dont see how it overpoweres the bloody thing. If anything it makes it harder to use. In any case just tried a bit, and getting double hits in is not really hard at all even with that setting.

Then again i guess the idea of a 1.1 mode for 1.2 is a bit old to the players nowadays.
 
Swag
🌈 Beta Tester
👮 Moderator
✔️ HL Verified
🚂 Steam Linked
🌟 Senior Member
Joined
May 9, 2009
Messages
922
Best answers
1
Location
Behind 'yo house!
I agree with hlev, Grega. It screws up too much and an amxx code is probably needed to go for exactly what the dude wanted.

@Hlev, that web compiler always ****s up stuff.
 

Users who are viewing this thread

Top Bottom