Raised This Month: $ Target: $400
 0% 

(L4D2)Plugin request! Help! I always wondered if the special zombio


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
login101
Senior Member
Join Date: Sep 2017
Old 11-27-2019 , 09:13   Re: (L4D2)Plugin request! Help! I always wondered if the special zombio
Reply With Quote #3

Quote:
Originally Posted by BHaType View Post
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<= MaxClientsi++)
        
g_flTime[i] = 0.0;
}

public 
Action OnPlayerRunCmd(int clientint &buttons)
{
    if (
GetClientTeam(client) != || !IsPlayerAlive(client) || !(buttons IN_ATTACK2) || GetGameTime() - g_flTime[client] < CoolDown)
        return;
        
    
int iTarget GetClientAimTarget(clientfalse);
    
    if (
iTarget <= MaxClients || GetDistance(clientiTarget) > MAXDISTANCE)
        return;
        
    
char szName[56];
    
GetEntityClassname(iTargetszNamesizeof szName);
    
    if (
StrContains(szName"prop_door_rotating") != -1)
        
AcceptEntityInput(iTarget"Toggle");
        
    
g_flTime[client] = GetGameTime();
}

float GetDistance(int a1int a2)
{
    
float vOrigin[3], vPos[3];
    
    
GetClientEyePosition(a1vOrigin);
    
GetEntPropVector(a2Prop_Send"m_vecOrigin"vPos);
    
    return 
GetVectorDistance(vOriginvPos);

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.
login101 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode