 |
|
Senior Member
|

11-27-2019
, 09:13
Re: (L4D2)Plugin request! Help! I always wondered if the special zombio
|
#3
|
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); }
|
Thank you very much for your help. Um ... Is it possible to open only closed doors? Only open locked doors Open only closed doors
ai I want to open only closed doors.
Last edited by login101; 11-27-2019 at 09:14.
|
|
|
|