 |
|
Senior Member
|

11-28-2019
, 01:19
Re: (L4D2)Plugin request! Help! I always wondered if the special zombio
|
#4
|
Quote:
Originally Posted by BHaType
Try this
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, "Toggle"); 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); }
|
The multiple rock plugins you shared are really fun !!
Applied to my tank !! 04  7 ~ 06:55
https://youtu.be/qnwum3K8i0g
ThanksThanksThanksThanksThanksThanksThanks
Last edited by login101; 11-28-2019 at 01:21.
|
|
|
|