Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma semicolon 1
- #define PLUGIN_VERSION "0.00"
- #include <sourcemod>
- #include <sdktools>
- #include <l4d2_aidetours>
- public Plugin:myinfo =
- {
- name = "[L4D2] Tank AI Tester",
- author = "DeathChaos25",
- description = "Forcing tanks to prioritize incaps",
- version = PLUGIN_VERSION,
- url = "https://forums.alliedmods.net/showthread.php?t=261566"
- };
- public Action:L4D2_OnTankAttackUpdate(tank, &victim)
- {
- if (IsInfected(tank) && IsTank(tank) && IsPlayerAlive(tank))
- {
- for (new target = 1; target <= MaxClients; target++)
- {
- if (IsSurvivor(target) && IsPlayerAlive(target) && IsIncaped(target))
- {
- PrintToChatAll("Tank (%i, %N) has changed targets to Survivor %N! (id:%i)", tank, tank, target, target);
- victim = GetEntData(target, L4D2_RefEntityHandle());
- return Plugin_Changed;
- }
- }
- }
- return Plugin_Continue;
- }
- stock bool:IsTank(client)
- {
- return GetEntProp(client, Prop_Send, "m_zombieClass") == 8;
- }
- stock bool:IsSurvivor(client)
- {
- return client > 0 && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2;
- }
- stock bool:IsInfected(client)
- {
- return client > 0 && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 3;
- }
- stock bool:IsIncaped(client)
- {
- return bool:GetEntProp(client, Prop_Send, "m_isIncapacitated", 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement