Misc changes

This commit is contained in:
Jackz 2023-12-23 12:30:25 -06:00
parent ede9b88b10
commit 0b189669b5
No known key found for this signature in database
GPG key ID: E0BBD94CF657F603
11 changed files with 4366 additions and 130 deletions

View file

@ -454,13 +454,11 @@ Action Timer_DirectorWitch(Handle h) {
void DirectorSpawn(specialType special, int player = -1) {
if(player <= 0)
player = GetSuitableVictim();
// PrintDebug(DEBUG_SPAWNLOGIC, "Director: spawning %s(%d) around %N (cnt=%d,lim=%d)", SPECIAL_IDS[view_as<int>(special)], special, player, g_spawnCount[view_as<int>(special)], g_spawnLimit[view_as<int>(special)]);
if(special != Special_Witch && special != Special_Tank) {
// Bypass director
int bot = CreateFakeClient("EPI_BOT");
if (bot != 0) {
ChangeClientTeam(bot, 3);
CreateTimer(0.1, Timer_Kick, bot);
}
}

View file

@ -17,8 +17,14 @@ enum struct HatPreset {
ArrayList locations;
int Spawn() {
PrecacheModel(this.model);
if(!PrecacheModel(this.model)) {
LogError("[Hats] Failed to precache preset model: \"%s\"", this.model);
}
int entity = CreateEntityByName(this.type);
if(entity == -1) {
LogError("[Hats] Failed to spawn hat for type %s: \"%s\"", this.type, this.model);
}
DispatchKeyValue(entity, "solid", "6");
DispatchKeyValue(entity, "model", this.model);
if(HasEntProp(entity, Prop_Send, "m_flModelScale"))
SetEntPropFloat(entity, Prop_Send, "m_flModelScale", this.size);
@ -29,8 +35,8 @@ enum struct HatPreset {
}
int Apply(int client) {
int entity = this.Spawn();
float offset[3], angles[3];
int entity = this.Spawn(offset);
EquipHat(client, entity, this.type, HAT_PRESET);
this.GetLocation(client, offset, angles);
hatData[client].offset = offset;

View file

@ -266,38 +266,6 @@ stock bool GetGround(int client, float vPos[3], float vAng[3]) {
GetClientAbsAngles(client, vAng);
return true;
}
//Taken from https://forums.alliedmods.net/showthread.php?p=1741099
stock bool SpawnMinigun(const float vPos[3], const float vAng[3]) {
float vDir[3], newPos[3];
GetAngleVectors(vAng, vDir, NULL_VECTOR, NULL_VECTOR);
vDir[0] = vPos[0] + (vDir[0] * 50);
vDir[1] = vPos[1] + (vDir[1] * 50);
vDir[2] = vPos[2] + 20.0;
newPos = vDir;
newPos[2] -= 40.0;
Handle trace = TR_TraceRayFilterEx(vDir, newPos, MASK_SHOT, RayType_EndPoint, TraceFilter);
if(TR_DidHit(trace)) {
TR_GetEndPosition(vDir, trace);
int minigun = CreateEntityByName("prop_mounted_machine_gun");
minigun = EntIndexToEntRef(minigun);
SetEntityModel(minigun, MODEL_MINIGUN);
DispatchKeyValue(minigun, "targetname", "louis_holdout");
DispatchKeyValueFloat(minigun, "MaxPitch", 360.00);
DispatchKeyValueFloat(minigun, "MinPitch", -360.00);
DispatchKeyValueFloat(minigun, "MaxYaw", 90.00);
newPos[2] += 0.1;
TeleportEntity(minigun, vDir, vAng, NULL_VECTOR);
DispatchSpawn(minigun);
delete trace;
return true;
}else{
LogError("Spawn minigun trace failure");
delete trace;
return false;
}
}
stock int GiveClientWeaponLasers(int client, const char[] wpnName) {
int entity = GiveClientWeapon(client, wpnName);