mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-07 21:23:22 +00:00
Merge branch 'master' of github.com:Jackzmc/sourcemod-plugins
This commit is contained in:
commit
e762ae8de2
4 changed files with 30 additions and 8 deletions
|
@ -27,6 +27,7 @@ public void OnMapStart() {
|
||||||
public void OnClientPutInServer(int client) {
|
public void OnClientPutInServer(int client) {
|
||||||
pdata[client].pendingTrollBan = 0;
|
pdata[client].pendingTrollBan = 0;
|
||||||
pdata[client].shootAtTarget = 0;
|
pdata[client].shootAtTarget = 0;
|
||||||
|
fAntiRushFrequencyCounter[client] = 0.0;
|
||||||
if(IsTrollActive(client, "Voice Mute"))
|
if(IsTrollActive(client, "Voice Mute"))
|
||||||
BaseComm_SetClientMute(client, true);
|
BaseComm_SetClientMute(client, true);
|
||||||
SDKHook(client, SDKHook_OnTakeDamage, Event_TakeDamage);
|
SDKHook(client, SDKHook_OnTakeDamage, Event_TakeDamage);
|
||||||
|
@ -907,12 +908,15 @@ public bool TraceEntityFilterPlayer(int entity, int mask, any data) {
|
||||||
return data != entity && entity <= MaxClients && GetClientTeam(entity) == 2 && IsPlayerAlive(entity);
|
return data != entity && entity <= MaxClients && GetClientTeam(entity) == 2 && IsPlayerAlive(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
float iLastAntiRushEvent[MAXPLAYERS+1];
|
// TODO: Increase the frequency of spawns the longer they are in antirush. Possibly increase int and decrease over time
|
||||||
public Action OnAntiRush(int client, int &type, float distance) {
|
public Action OnAntiRush(int client, int &type, float distance) {
|
||||||
if(client && client > 0 && client <= MaxClients && type == 3 && IsPlayerAlive(client) && !IsPlayerIncapped(client)) {
|
if(client && client > 0 && client <= MaxClients && type == 3 && IsPlayerAlive(client) && !IsPlayerIncapped(client)) {
|
||||||
if(GetGameTime() - iLastAntiRushEvent[client] > 30.0) {
|
if(GetGameTime() - fLastAntiRushEvent[client] > ANTI_RUSH_DEFAULT_FREQUENCY - fAntiRushFrequencyCounter[client]) { <
|
||||||
|
if(fAntiRushFrequencyCounter[client] < ANTI_RUSH_DEFAULT_FREQUENCY) {
|
||||||
|
fAntiRushFrequencyCounter[client] += ANTI_RUSH_FREQ_INC;
|
||||||
|
}
|
||||||
SpecialType special = view_as<SpecialType>(GetRandomInt(1,6));
|
SpecialType special = view_as<SpecialType>(GetRandomInt(1,6));
|
||||||
iLastAntiRushEvent[client] = GetGameTime();
|
fLastAntiRushEvent[client] = GetGameTime();
|
||||||
SpawnSpecialForTarget(special, client);
|
SpawnSpecialForTarget(special, client);
|
||||||
PrintToConsoleAll("[FTT] Spawning anti-rush special on %N (dist=%f) (special=%s)", client, distance, SPECIAL_NAMES[view_as<int>(special)-1]);
|
PrintToConsoleAll("[FTT] Spawning anti-rush special on %N (dist=%f) (special=%s)", client, distance, SPECIAL_NAMES[view_as<int>(special)-1]);
|
||||||
}
|
}
|
||||||
|
@ -920,6 +924,17 @@ public Action OnAntiRush(int client, int &type, float distance) {
|
||||||
return Plugin_Continue;
|
return Plugin_Continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Action Timer_DecreaseAntiRush(Handle h) {
|
||||||
|
for(int i = 1; i <= MaxClients; i++) {
|
||||||
|
if(fAntiRushFrequencyCounter[i] > 1.0) {
|
||||||
|
fAntiRushFrequencyCounter[i]--;
|
||||||
|
} else {
|
||||||
|
fAntiRushFrequencyCounter = 0.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Plugin_Continue;
|
||||||
|
}
|
||||||
|
|
||||||
public void L4D2_CInsectSwarm_CanHarm_Post(int acid, int spitter, int entity) {
|
public void L4D2_CInsectSwarm_CanHarm_Post(int acid, int spitter, int entity) {
|
||||||
if(entity <= MaxClients)
|
if(entity <= MaxClients)
|
||||||
pdata[entity].lastInSpitTime = GetGameTime();
|
pdata[entity].lastInSpitTime = GetGameTime();
|
||||||
|
|
|
@ -93,6 +93,9 @@ Handle stopHealingTimer;
|
||||||
|
|
||||||
float entLastHeight[2048];
|
float entLastHeight[2048];
|
||||||
|
|
||||||
|
float fLastAntiRushEvent[MAXPLAYERS+1];
|
||||||
|
float fAntiRushFrequencyCounter[MAXPLAYERS+1];
|
||||||
|
|
||||||
|
|
||||||
#define MODEL_CAR "models/props_vehicles/cara_95sedan.mdl"
|
#define MODEL_CAR "models/props_vehicles/cara_95sedan.mdl"
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
//#define DEBUG
|
//#define DEBUG
|
||||||
|
|
||||||
#define PLUGIN_VERSION "1.0"
|
#define PLUGIN_VERSION "1.0"
|
||||||
#define BILE_NO_HORDE_THRESHOLD 20
|
#define BILE_NO_HORDE_THRESHOLD 5
|
||||||
#define DOOR_CLOSE_THRESHOLD 5000.0
|
#define DOOR_CLOSE_THRESHOLD 5000.0
|
||||||
|
|
||||||
#include <sourcemod>
|
#include <sourcemod>
|
||||||
|
@ -172,7 +172,7 @@ public void OnEntityDestroyed(int entity) {
|
||||||
static char classname[16];
|
static char classname[16];
|
||||||
if(IsValidEntity(entity) && entity <= 4096) {
|
if(IsValidEntity(entity) && entity <= 4096) {
|
||||||
GetEntityClassname(entity, classname, sizeof(classname));
|
GetEntityClassname(entity, classname, sizeof(classname));
|
||||||
if(StrEqual(classname, "vomitjar_projec")) {
|
if(StrEqual(classname, "vomitjar_projec")) { //t cut off by classname size
|
||||||
int thrower = GetEntPropEnt(entity, Prop_Send, "m_hThrower");
|
int thrower = GetEntPropEnt(entity, Prop_Send, "m_hThrower");
|
||||||
if(thrower > 0 && thrower <= MaxClients && IsClientConnected(thrower) && IsClientInGame(thrower)) {
|
if(thrower > 0 && thrower <= MaxClients && IsClientConnected(thrower) && IsClientInGame(thrower)) {
|
||||||
static float src[3];
|
static float src[3];
|
||||||
|
@ -193,7 +193,7 @@ public void OnEntityDestroyed(int entity) {
|
||||||
|
|
||||||
if(result == Plugin_Stop) {
|
if(result == Plugin_Stop) {
|
||||||
AcceptEntityInput(entity, "kill");
|
AcceptEntityInput(entity, "kill");
|
||||||
GiveClientWeapon(thrower, "vomitjar");
|
// GiveClientWeapon(thrower, "vomitjar");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
#define MAIN_TIMER_INTERVAL_S 5.0
|
#define MAIN_TIMER_INTERVAL_S 5.0
|
||||||
#define PLUGIN_VERSION "1.0"
|
#define PLUGIN_VERSION "1.0"
|
||||||
|
#define ANTI_RUSH_DEFAULT_FREQUENCY 30.0
|
||||||
|
#define ANTI_RUSH_FREQ_INC 0.5
|
||||||
|
|
||||||
#include <sourcemod>
|
#include <sourcemod>
|
||||||
#include <sdktools>
|
#include <sdktools>
|
||||||
|
@ -44,6 +46,8 @@ public void OnPluginStart() {
|
||||||
SetupTrolls();
|
SetupTrolls();
|
||||||
SetupsTrollCombos();
|
SetupsTrollCombos();
|
||||||
|
|
||||||
|
CreateTimer(1.0, Timer_DecreaseAntiRush, TIMER_REPEAT);
|
||||||
|
|
||||||
g_spSpawnQueue = new ArrayList(sizeof(SpecialSpawnRequest));
|
g_spSpawnQueue = new ArrayList(sizeof(SpecialSpawnRequest));
|
||||||
|
|
||||||
// Witch target overwrite stuff:
|
// Witch target overwrite stuff:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue