mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-06 12:03:20 +00:00
Improve botsheal
This commit is contained in:
parent
8d05131fb2
commit
e2bab10085
4 changed files with 13 additions and 11 deletions
Binary file not shown.
|
@ -640,17 +640,19 @@ public Action Command_HealTarget(int client, int args) {
|
|||
StopHealingBots();
|
||||
} else {
|
||||
healTargetPlayer = targetUserId;
|
||||
CreateTimer(3.0, Timer_UpdateHealTargetPos, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
|
||||
CreateTimer(2.0, Timer_UpdateHealTargetPos, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
|
||||
|
||||
int limit = StringToInt(arg2);
|
||||
if(limit <= 0) limit = MaxClients;
|
||||
bool addBots = limit < 0;
|
||||
if(limit < 0) limit = -limit;
|
||||
else if(limit == 0) limit = MaxClients;
|
||||
for(int i = 1; i <= MaxClients; i++) {
|
||||
if(IsClientConnected(i) && IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == 2 && IsFakeClient(i)) {
|
||||
int kit = GetPlayerWeaponSlot(i, 3);
|
||||
if(kit > 0) {
|
||||
GetEntityClassname(kit, arg1, sizeof(arg1));
|
||||
if(StrEqual(arg1, "weapon_first_aid_kit")) {
|
||||
pdata[i].flags &= view_as<int>(Flag_IsTargettingHealer);
|
||||
pdata[i].flags |= view_as<int>(Flag_IsTargettingHealer);
|
||||
|
||||
if(--limit == 0) {
|
||||
break;
|
||||
|
@ -659,7 +661,7 @@ public Action Command_HealTarget(int client, int args) {
|
|||
}
|
||||
}
|
||||
}
|
||||
if(limit > 0) {
|
||||
if(addBots && limit > 0) {
|
||||
wasAbmAutoHard = hAbmAutoHard.IntValue;
|
||||
hAbmAutoHard.IntValue = 0;
|
||||
CreateTimer(0.2, Timer_SpawnBots, limit, TIMER_FLAG_NO_MAPCHANGE | TIMER_REPEAT);
|
||||
|
|
|
@ -26,6 +26,12 @@ ConVar hBotReverseFFDefend;
|
|||
ConVar hSbFriendlyFire;
|
||||
ConVar hBotDefendChance;
|
||||
|
||||
ConVar hSbFixEnabled;
|
||||
bool wasSbFixEnabled;
|
||||
|
||||
int wasAbmAutoHard;
|
||||
ConVar hAbmAutoHard;
|
||||
|
||||
enum playerDataFlags {
|
||||
Flag_PendingItemGive = 1,
|
||||
Flag_HasSpitTimer = 2,
|
||||
|
@ -83,12 +89,6 @@ enum SpecialInternalFlags {
|
|||
int healTargetPlayer;
|
||||
float healTargetPos[3];
|
||||
|
||||
bool wasSbFixEnabled;
|
||||
ConVar hSbFixEnabled;
|
||||
|
||||
ConVar hAbmAutoHard;
|
||||
int wasAbmAutoHard;
|
||||
|
||||
#define MODEL_CAR "models/props_vehicles/cara_95sedan.mdl"
|
||||
|
||||
#include <feedthetrolls/base>
|
||||
|
|
|
@ -36,7 +36,7 @@ public Plugin myinfo =
|
|||
public void OnPluginStart() {
|
||||
EngineVersion g_Game = GetEngineVersion();
|
||||
if(g_Game != Engine_Left4Dead2) {
|
||||
SetFailState("This plugin is for L4D/L4D2 only.");
|
||||
SetFailState("This plugin is for L4D2 only.");
|
||||
}
|
||||
LoadTranslations("common.phrases");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue