|
Author
|
Message
|
|
Senior Member
|

11-28-2019
, 00:08
Re: (L4D2)Plugin request! Help! I always wondered if the special zombio
|
#1
|
Quote:
Originally Posted by BHaType
PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
#include <sdktools>
#define CoolDown 0.5
#define MAXDISTANCE 60.0
float g_flTime[MAXPLAYERS + 1];
public void OnMapEnd()
{
for (int i = 1; i <= MaxClients; i++)
g_flTime[i] = 0.0;
}
public Action OnPlayerRunCmd(int client, int &buttons)
{
if (GetClientTeam(client) != 3 || !IsPlayerAlive(client) || !(buttons & IN_ATTACK2) || GetGameTime() - g_flTime[client] < CoolDown)
return;
int iTarget = GetClientAimTarget(client, false);
if (iTarget <= MaxClients || GetDistance(client, iTarget) > MAXDISTANCE)
return;
char szName[56];
GetEntityClassname(iTarget, szName, sizeof szName);
if (StrContains(szName, "prop_door_rotating") != -1)
AcceptEntityInput(iTarget, "Open");
g_flTime[client] = GetGameTime();
}
float GetDistance(int a1, int a2)
{
float vOrigin[3], vPos[3];
GetClientEyePosition(a1, vOrigin);
GetEntPropVector(a2, Prop_Send, "m_vecOrigin", vPos);
return GetVectorDistance(vOrigin, vPos);
}
|
Can I add a tank? ㅇㅅㅇ
|
|
|
|