text
stringlengths
0
692
#define SF_BRUSH_ROTATE_Z_AXIS 4
#define SF_BRUSH_ROTATE_X_AXIS 8
#define SF_PENDULUM_AUTO_RETURN 16
#define SF_PENDULUM_PASSABLE 32
#define SF_BRUSH_ROTATE_SMALLRADIUS 128
#define SF_BRUSH_ROTATE_MEDIUMRADIUS 256
#define SF_BRUSH_ROTATE_LARGERADIUS 512
// triggers
#define SF_TRIGGER_ALLOWMONSTERS 1 // Monsters allowed to fire this trigger
#define SF_TRIGGER_NOCLIENTS 2 // Players not allowed to fire this trigger
#define SF_TRIGGER_PUSHABLES 4 // Only pushables can fire this trigger
#define SF_TRIG_PUSH_ONCE 1
// func_breakable
#define SF_BREAK_TRIGGER_ONLY 1 // May only be broken by trigger
#define SF_BREAK_TOUCH 2 // Can be 'crashed through' by running player (plate glass)
#define SF_BREAK_PRESSURE 4 // Can be broken by a player standing on it
#define SF_BREAK_CROWBAR 256 // Instant break if hit with crowbar
// func_pushable (it's also func_breakable, so don't collide with those flags)
#define SF_PUSH_BREAKABLE 128
// light_spawn
#define SF_LIGHT_START_OFF 1
#define SPAWNFLAG_NOMESSAGE 1
#define SPAWNFLAG_NOTOUCH 1
#define SPAWNFLAG_DROIDONLY 4
#define SPAWNFLAG_USEONLY 1 // Can't be touched, must be used (buttons)
// Monster Spawnflags
#define SF_MONSTER_WAIT_TILL_SEEN 1 // Spawnflag that makes monsters wait until player can see them before attacking
#define SF_MONSTER_GAG 2 // No idle noises from this monster
#define SF_MONSTER_HITMONSTERCLIP 4
#define SF_MONSTER_PRISONER 16 // Monster won't attack anyone, no one will attacke him
#define SF_MONSTER_WAIT_FOR_SCRIPT 128 // Spawnflag that makes monsters wait to check for attacking until the script is done or they've been attacked
#define SF_MONSTER_PREDISASTER 256 // This is a predisaster scientist or barney; influences how they speak
#define SF_MONSTER_FADECORPSE 512 // Fade out corpse after death
#define SF_MONSTER_FALL_TO_GROUND 0x80000000
#define SF_MONSTER_TURRET_AUTOACTIVATE 32
#define SF_MONSTER_TURRET_STARTINACTIVE 64
#define SF_MONSTER_WAIT_UNTIL_PROVOKED 64 // Don't attack the player unless provoked
// info_decal
#define SF_DECAL_NOTINDEATHMATCH 2048
// worldspawn
#define SF_WORLD_DARK 0x0001 // Fade from black at startup
#define SF_WORLD_TITLE 0x0002 // Display game title at startup
#define SF_WORLD_FORCETEAM 0x0004 // Force teams
// Set this bit on guns and stuff that should never respawn
#define SF_NORESPAWN (1<<30)
This tutorial is for an engine-to-fakemeta conversion for the functions set_speak() and get_speak().
First, we'll start off by defining the variables.
Code:
#include <amxmodx>
#include <fakemeta>
#define SPEAK_MUTED 0
#define SPEAK_NORMAL 1
#define SPEAK_ALL 2
#define SPEAK_LISTENALL 4
#define SPEAK_TEAM 8
Now, "What is 'SPEAK_TEAM' ?"
SPEAK_TEAM is a new one that I have thought up myself.
It acts as if alltalk is on, but only for that team.
Example:
I'm dead, and I can still talk to my alive teammates, but not to the other team.
Now, we will need to create a variable so each player can have his/her own flag.
And, we will need to reset the player's flag to SPEAK_NORMAL when he/she enters.
Code:
new g_iSpeakFlags[33];
public client_connect(id)
{
g_iSpeakFlags[id] = SPEAK_NORMAL;
}
We will need some functions to get and set the player's speak mode.
Code:
#define fm_get_speak(%1) g_iSpeakFlags[%1]
#define fm_set_speak(%1, %2) g_iSpeakFlags[%1] = %2
fm_get_speak(index) - returns a player's speak mode
fm_set_speak(index, iSpeakFlag) - sets a player's speak mode
To hook when a player talks, we will need to register the forward FM_Voice_SetClientListening.
Code:
public plugin_init()
{
register_forward(FM_Voice_SetClientListening, "fwd_FM_Voice_SetClientListening");
}