This commit is contained in:
Jackz 2023-04-29 10:25:49 -05:00
parent 078b7c4bf6
commit cb66da2ca2
No known key found for this signature in database
GPG key ID: E0BBD94CF657F603
50 changed files with 3176 additions and 383 deletions

View file

@ -101,14 +101,21 @@ bool ProcessSpecialQueue() {
CheatCommand(target, "z_spawn_old", SPECIAL_NAMES[view_as<int>(spActiveRequest.type) - 1], "auto");
} else if(spActiveRequest.type == Special_Witch) {
int witch = L4D2_SpawnWitch(spActiveRequest.position, spActiveRequest.angle);
DataPack pack;
CreateDataTimer(0.2, Timer_SetWitchTarget, pack);
pack.WriteCell(witch);
pack.WriteCell(GetClientUserId(target));
if(witch != -1)
SetWitchTarget(witch, target);
return ProcessSpecialQueue();
} else if(spActiveRequest.type == Special_Tank) {
// BypassLimit();
int tank = L4D2_SpawnTank(spActiveRequest.position, spActiveRequest.angle);
if(tank > 0 && IsClientConnected(tank))
if(tank > 0 && IsClientConnected(tank)) {
PrintToConsoleAll("[ftt/debug] requested tank spawned %d -> %N", tank, target)
pdata[tank].attackerTargetUid = spActiveRequest.targetUserId;
pdata[tank].specialAttackFlags = view_as<int>(SPI_AlwaysTarget);
}
return ProcessSpecialQueue();
}
return true;
@ -117,6 +124,16 @@ bool ProcessSpecialQueue() {
return false;
}
Action Timer_SetWitchTarget(Handle h, DataPack pack) {
pack.Reset();
int witch = pack.ReadCell();
int target = GetClientOfUserId(pack.ReadCell());
if(IsValidEntity(witch) && target > 0) {
SetWitchTarget(witch, target);
}
return Plugin_Handled;
}
stock SpecialType GetSpecialType(const char[] input) {
for(int i = 0; i < 8; i++) {
if(strcmp(SPECIAL_NAMES[i], input, false) == 0) return view_as<SpecialType>(i + 1);