mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-07 14:23:20 +00:00
update betterwitchavoidance
This commit is contained in:
parent
13b1e424e2
commit
1673098d2c
1 changed files with 29 additions and 16 deletions
|
@ -1,8 +1,6 @@
|
|||
#pragma semicolon 1
|
||||
#pragma newdecls required
|
||||
|
||||
#define DEBUG
|
||||
|
||||
#define PLUGIN_NAME "Better Witch Avoidance"
|
||||
#define PLUGIN_DESCRIPTION "Makes bots avoid witches better"
|
||||
#define PLUGIN_AUTHOR "jackzmc"
|
||||
|
@ -13,7 +11,6 @@
|
|||
#include <sdktools>
|
||||
//#include <sdkhooks>
|
||||
|
||||
#pragma newdecls required
|
||||
|
||||
public Plugin myinfo =
|
||||
{
|
||||
|
@ -56,8 +53,8 @@ public Action BotControlTimer(Handle timer)
|
|||
//FindExistingWitch();
|
||||
return Plugin_Stop;
|
||||
}
|
||||
if(HasEntProp(iWitchEntity,Prop_Send,"m_rage")) {
|
||||
float witch_anger = GetEntPropFloat(iWitchEntity, Prop_Send, "m_rage", 0);
|
||||
ShowHintToAll("Witch (%d) Rage=%f", iWitchEntity, witch_anger);
|
||||
if(FloatCompare(witch_anger,0.4) == 1) {
|
||||
float WitchPosition[3];
|
||||
GetEntPropVector(iWitchEntity, Prop_Send, "m_vecOrigin", WitchPosition);
|
||||
|
@ -73,9 +70,25 @@ public Action BotControlTimer(Handle timer)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Plugin_Handled;
|
||||
}
|
||||
public void FindExistingWitch() {
|
||||
for (int i = MaxClients + 1; i < GetMaxEntities(); i++) {
|
||||
if(IsValidEntity(i)) {
|
||||
char name[16];
|
||||
GetEntityClassname(i, name, sizeof(name));
|
||||
if(StrContains(name,"Witch",true) > -1) {
|
||||
PrintToServer("Found existing witch with id %d", i);
|
||||
iWitchEntity = i;
|
||||
CreateTimer(0.1, BotControlTimer, _, TIMER_REPEAT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//Credits to Timocop for the stock :D
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue