Some Useful AMXX Stuff

NOT IN THE MANGA™
★ Black Lounger ★
✔️ HL Verified
🚂 Steam Linked
💻 Oldtimer
Joined
Jan 5, 2008
Messages
3,276
Best answers
0
Location
Lithuania
Some useful AMXX-related things for ESF, like efficient ways to perform various actions, etc. I may post more once in a while.
Code:
#include <fun>

#define WEAPON_MELEE 1
#define WEAPON_SWORD 2
#define WEAPON_KIBLAST 3
#define WEAPON_GENERICBEAM 4
#define WEAPON_GALLITGUN 5
#define WEAPON_KAMEHAMEHA 6
#define WEAPON_DESTRUCTODISC 7
#define WEAPON_SOLARFLARE 8
#define WEAPON_EYELASER 9
#define WEAPON_FRIEZADISC 10
#define WEAPON_SPECIALBEAMCANNON 11
#define WEAPON_SPIRITBOMB 12
#define WEAPON_BIGBANG 13
#define WEAPON_FINGERLASER 14
#define WEAPON_FINALFLASH 15
#define WEAPON_MASENKO 16
#define WEAPON_DEATHBALL 17
#define WEAPON_BURNINGATTACK 18
#define WEAPON_SCATTERBEAM 19
#define WEAPON_CANDY 20
#define WEAPON_SCATTERSHOT 21
#define WEAPON_POWERBEAM 22
#define WEAPON_MOUTHBLAST 23
#define WEAPON_FINISHINGBUSTER 24
#define WEAPON_SENSU 25
#define WEAPON_DRAGONBALL 26
#define WEAPON_BODYPART 27
#define WEAPON_SHIELDATTACK 28
#define WEAPON_REGENERATION 29
#define WEAPON_RENZOKU 30
#define WEAPON_KAMETORPEDO 32
#define WEAPON_TELEKINESIS 33
#define WEAPON_FLAMETHROWER 34

stock const _WeaponNames[][] =
{
	"",
	"weapon_melee",
	"weapon_sword",
	"weapon_kiblast",
	"weapon_genericbeam",
	"weapon_gallitgun",
	"weapon_kamehameha",
	"weapon_destructodisc",
	"weapon_solarflare",
	"weapon_eyelaser",
	"weapon_friezadisc",
	"weapon_specialbeamcannon",
	"weapon_spiritbomb",
	"weapon_bigbang",
	"weapon_fingerlaser",
	"weapon_finalflash",
	"weapon_masenko",
	"weapon_deathball",
	"weapon_burningattack",
	"weapon_scatterbeam",
	"weapon_candy",
	"weapon_scattershot",
	"weapon_powerbeam",
	"weapon_mouthblast",
	"weapon_finishingbuster",
	"weapon_sensu",
	"weapon_dragonball",
	"weapon_bodypart",
	"weapon_shieldattack",
	"weapon_regeneration",
	"weapon_renzoku",
	"",
	"weapon_kametorpedo",
	"weapon_telekinesis",
	"weapon_flamethrower"
};

#define GiveWeapon(%0,%1) give_item(%0, _WeaponNames[%1]);
Code:
#include <engine>
#include <fakemeta>

new const AuraClassname[] = "aura";

public plugin_init()
	register_event("ManipModel", "OnManipModel", "a", "1=10");

public OnManipModel() // This is called on turbo activation and swoop start
{
	// read_data(2) - aura entity's ID
	// entity_get_edict(read_data(2), EV_ENT_owner) - aura owner's ID
	entity_set_string(read_data(2), EV_SZ_classname, AuraClassname);
}

#define GetTurbo(%0) get_pdata_int(%0, 196)
#define GetSwooping(%0) get_pdata_int(%0, 317)
#define GetAura(%0) find_ent_by_owner(-1, AuraClassname, %0) // Should first check if turbo or swooping
Code:
#include <engine>
#include <fakemeta>

public client_infochanged(id)
{
	if (!is_user_connected(id))
		return;

	// If this forward is called, it's possible that player's model has changed
	// Use this forward to make sure the player always keeps his custom model without it resetting.
	//SetPlayerModel(id, "custom"); // Must be in "models/player/custom/custom.mdl" and precached!
}

stock SetPlayerModel(id, const model[])
{
	new path[128];
	formatex(path, sizeof path - 1, "models/player/%s/%s.mdl", model, model);

	set_pdata_string(id, 1420, model, -1, 20);
	entity_set_model(id, path);
}
 
Last edited:
New Member
✔️ HL Verified
Joined
Apr 10, 2011
Messages
19
Best answers
0
Location
Lithuania
Useful parts of script. Maybe i'll use it somewhere. Thanks for sharing it :)
 

Users who are viewing this thread

Top Bottom