Swoop Trail (ESF 1.2.3) AMXX

NOT IN THE MANGA™
★ Black Lounger ★
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Jan 5, 2008
Messages
3,276
Best answers
0
Location
Lithuania
Hello. Can anyone provide me a code for AMX Mod X that adds swoop trail to ESF 1.2.3? Thanks.
 
ESF Coder
🌠 Staff
Joined
Jun 13, 2004
Messages
585
Best answers
0
Location
Austria -> Vienna
send a message via svc_tempentity

#define TE_BEAMFOLLOW 22 // create a line of decaying beam segments until entity stops moving
// short (entity:attachment to follow)
// short (sprite index)
// byte (life in 0.1's)
// byte (line width in 0.1's)
// byte,byte,byte (color)
// byte (brightness)
 
NOT IN THE MANGA™
★ Black Lounger ★
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Jan 5, 2008
Messages
3,276
Best answers
0
Location
Lithuania
Thanks. In what forward should I use that?
 
ESF Coder
🌠 Staff
Joined
Jun 13, 2004
Messages
585
Best answers
0
Location
Austria -> Vienna
yep, postthink should be fine
but be carefull, check
if( isSwooping[client] && !wasSwooping[client] )
//...write message

wasSwooping = the value stored from the last frame if he was swooping, without it you would send this message every frame which will look really ugly xD
 
Project Manager
🌠 Staff
✔️ HL Verified
💻 Oldtimer
Joined
Nov 25, 2001
Messages
1,729
Best answers
0
oh and remember there is also a stop message for this one.
 
AMXX Coder (:
✔️ HL Verified
Discord Member
Joined
Dec 31, 2008
Messages
55
Best answers
0
in this plugin you can use my esf_util.inc for esf_get_swooping:cool:
 
NOT IN THE MANGA™
★ Black Lounger ★
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Jan 5, 2008
Messages
3,276
Best answers
0
Location
Lithuania
in this plugin you can use my esf_util.inc for esf_get_swooping:cool:
Like it's hard to get the number from offset 317. LOL.

EDIT: If anyone ever needs it:
Code:
#include <amxmodx>
#include <fakemeta>

#define MAX_PLAYERS 32

#define OFFSET_SWOOPING 317
#define EXTRAOFFSET 5

#define TE_BEAMFOLLOW 22
#define TE_KILLBEAM 99

#define TRAIL_LIFE 6
#define TRAIL_SIZE 6
#define TRAIL_RED 32
#define TRAIL_GREEN 32
#define TRAIL_BLUE 32
#define TRAIL_BRIGHTNESS 96

new WasSwooping[MAX_PLAYERS + 1];
new SwoopTrailSprite;

public plugin_precache()
	SwoopTrailSprite = precache_model("sprites/swooptrail.spr");

public plugin_init()
{
	register_plugin("Swoop Trail", "1.0", "hleV");

	register_forward(FM_CmdStart, "CmdStart");
}

public CmdStart(Client)
{
	if (IsSwooping(Client) && !WasSwooping[Client])
	{
		WasSwooping[Client] = true;

		message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
		write_byte(TE_BEAMFOLLOW);
		write_short(Client);
		write_short(SwoopTrailSprite);
		write_byte(TRAIL_LIFE);
		write_byte(TRAIL_SIZE);
		write_byte(TRAIL_RED);
		write_byte(TRAIL_GREEN);
		write_byte(TRAIL_BLUE);
		write_byte(TRAIL_BRIGHTNESS);
		message_end();
	}
	else if (!IsSwooping(Client) && WasSwooping[Client])
	{
		WasSwooping[Client] = false;

		message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
		write_byte(TE_KILLBEAM);
		write_short(Client);
		message_end();
	}
}

stock IsSwooping(Client)
	return get_pdata_int(Client, OFFSET_SWOOPING, EXTRAOFFSET);
 
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
This isn't a public plugin. It's just a code for someone who needs a working swoop trail code.

Also it's easy to check the class, but I have no idea how to check if player is transformed.
 

Users who are viewing this thread

Top Bottom